ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Error using GetImageToStream, please help :)

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Gubben Posted - May 15 2016 : 10:24:25
This code gives an Access Violation and I'm not able to solve it.

If there is one image only, no error. If there are two or more images, error. But if I click inside the ImageEnMview before running this code, there is no error even with two or more images.

I'm stuck :)

var
ms : TMemorystream;

for i:=0 to ImageEnmView.imagecount-1 do
begin

try

ms:=TMemorystream.create;
ms.Position:=0;
ImageEnmView.MIO.Params[i].TIFF_Compression:=ioTIFF_JPEG;
ImageEnmView.MIO.Params[i].BitsPerSample:=2;
ImageEnmView.GetImageToStream(i,ms,iotiff);

....save to database...

finally
ms.Free;

end;
.....

Regards,
Ole

3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 18 2016 : 17:26:09
Hi Ole

Is it only related to the database or is it a general issue in GetImageToStream().

If so can you give us a small demo that reproduces the error so we can investigate.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Gubben Posted - May 18 2016 : 13:56:48
I have given up the GetImageToStream, it's simply not working for me, gives an AV. I tried hard to solve the problem, but With no luck.

I used it for a long time, the AV came when updating the component library.

I now use the the SaveTostreamtiff, and everyting works great again.

Regards,
Ole
w2m Posted - May 15 2016 : 11:04:47
I am not sure exactly what is occurring with your code, as you are not showing all the code. It could be caused by setting the stream position to 0 before calling GetImageToStream. Usually ms.Position is set to 0 only just before saving the stream to your database.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development