Author |
Topic  |
|
Gubben

Norway
11 Posts |
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
|
|
w2m
   
USA
1990 Posts |
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 |
 |
|
Gubben

Norway
11 Posts |
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 |
 |
|
xequte
    
38984 Posts |
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
|
 |
|
|
Topic  |
|
|
|