Hi Nigel,
what we do is following:
We use the ImageEnMView as preview in our own Document select/open Dialog.
What we make is not difficult. We only
function TDokPrivFrame.InsertThumb(Const fThumb: TIMageEnMView; Var aStream: TMemoryStream): Boolean;
begin
Result:=ImageEnMView_AppendImage(fThumb,aStream)<>-1;
FreeAndNil(aStream);
end;
Here you see the subfunctions.
function ImageEnMView_InsertImageEx(Const ImageMEV: TImageEnMView; SelectIt:Boolean=false):Integer;
begin
with ImageMEV do
begin
result:=ImageCount;
if SelectIt then InsertImageEx(Result, imsAlways)
else InsertImageEx(Result, imsAuto);
end;
end;
function ImageEnMView_AppendImage (Const ImageMEV: TImageEnMView; ImageStream: TMemoryStream; SelectIt: Boolean=false): Integer; overload;
begin
Result:=ImageEnMView_InsertImageEx(ImageMEV, SelectIt);
ImageStream.Position:=0;
ImageMEV.SetImageFromStream(Result, ImageStream);
end;
The special is, that we call the function to insert the Image inside a Thread. The error didn't happen with every image. To me is seems like it have something to do with the size of the image. May be the Thread also is involved.
Thanks
Ralf