Page 1 of 1

Corupted image in RichEdit

Posted: Tue Apr 22, 2008 2:32 pm
by jp
Hello
I'm niw to this forum and new to Richview, so please bearwith mee if I ask stupid questions ;-)

In application, witch I do some upgrating on, I get a corupted image. But unfortunaly it's not every time.

Have any one seen this before and could you please give me a direction witch I have toe look for a solution?

Image

JP

Posted: Wed Apr 23, 2008 5:47 am
by Sergey Tkachenko
If documents are stored in RVF format, images are stored using graphic.SaveToStream and LoadFromStream methods. So the problem should be in the graphic class used for this picture.
Or do you use RTF?

Posted: Wed Apr 23, 2008 9:27 am
by jp
Sergey Tkachenko thanks for your reply.

Yes it is a file in rvf format.

What happens is. Someone external are creating a rvf file using the ActionTestD2007 from you Demos. In this file are some jpg images.

In the application I'm updating this file is been shown in a RichviewEdit. I have debugged an came to a point where I got this error message:
"Poject ef33.exe raised exception Class EJEG with message 'JPEG error #68'."

This error comes in the RVItem.pas in the Procedure DrawImage at the line "Canvas,Draw(x, y, Image);"

Can someone give me a direction to for this error?

Thanks

JP

Posted: Wed Apr 23, 2008 9:34 pm
by Pieter Zijlstra
jp wrote: In the application I'm updating this file is been shown in a RichviewEdit. I have debugged an came to a point where I got this error message:
"Poject ef33.exe raised exception Class EJEG with message 'JPEG error #68'."

This error comes in the RVItem.pas in the Procedure DrawImage at the line "Canvas,Draw(x, y, Image);"

Can someone give me a direction to for this error?
http://dn.codegear.com/article/20433

Error 68 is 'Virtual array controller messed up'

Whatever that means :?

Posted: Thu Apr 24, 2008 3:59 pm
by Sergey Tkachenko
It's something wrong with TJPEGImage, unfortunately I do not know what to do with it.
TRichView only stores images using their SaveToStream/LoadFromStream methods, and draws using Canvas.Draw and Canvas.StertchDraw...

Posted: Fri Apr 25, 2008 8:37 am
by jp
Thanks Sergey and Pieter for helping me out.

I have found the reason for this behavior. I was copying a part out of a stream on basis of an token and this token was also found in the binary from the jpeg :-(

Thus no problem with Richview :-)

Thanks

JP