Good Morning!
I am trying to make thumbnails of images and add them to an imagelist.
The bmp does not seem to be "getting the picture."
procedure TfrmJJsQuilts_Config.btnImagesFolderClick(Sender: TObject);
var
sr: TSearchRec;
FileAttrs: Integer;
ms: TMemoryStream;
bmp: TBitmap;
jpg: TJPEGImage;
begin
if bffImages.Execute then
begin
frmJJsQuilts_Main.ilImages.Clear;
if FindFirst(bffImages.Directory + '\*.jp*', faAnyFile, sr) = 0 then
begin
ms := TMemoryStream.Create;
jpg:= TJPEGImage.Create;
bmp:= TBitmap.Create;
try
repeat
if (sr.Name[1] <> '.') and (sr.Name[1] <> '..') then
begin
jpg.LoadFromFile(bffImages.Directory + '\' + sr.Name);
jpg.SaveToStream(ms);
bmp.LoadFromStream(ms);
*** At this point, the Height & Width are zero, so the
ImageList gives me "Invalid Image Size". ***
frmJJsQuilts_Main.ilImages.Add(bmp, nil);
application.processmessages;
end;
until FindNext(sr) <> 0;
FindClose(sr);
finally
FreeAndNil(ms);
FreeAndNil(jpg);
FreeAndNil(bmp);
end;
end;
end;
end;
Can someone tell me what needs to be done to get this to work?
Is there an imagelist that can hold a jpg?
Thanks...Dan'l
[Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Yahoo! Groups gets a make over. See the new email design.
http://us.click.yahoo.com/XISQkA/lOaOAA/yQLSAA/i7folB/TM
--------------------------------------------------------------------~->
-----------------------------------------------------
Home page: http://groups.yahoo.com/group/delphi-en/
To unsubscribe: [EMAIL PROTECTED]
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/delphi-en/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/