Good question - case of me learning more every day. Thanks for bring that to
my attention.
Al+
> Why do you draw to a Bitmap and then draw the bitmap to the form.
> Can't you just draw the JPEG direct to the form since in both cases
> you're drawing to a TCanvas. Hide the form borders (Should the form
> Clientwidth or Width be set to match the JPEG).
>
> Something like {Untested code}
>
> var
>   JPG :TJPEGImage;
>   Frm :TForm;
> begin
>   JPG := TJPEGImage.Create;
>   Frm := TForm.Create(nil);
>   with Frm do try
>     BorderStyle := boNone;
>     Position := poScreenCenter;
>     JPG.LoadFromFile('TheImage.Jpg');
>     ClientWidth := JPG.Width;
>     ClientHeight := JPG.Height;
>     Show;
>     Canvas.Draw(0,0,JPG);
>     {Do stuff here}
>   finally
>     if JPG<>nil then JPG.Free;
>     if FRM<>nil then FRM.Release;
>   end;
> end;
>
> >         try form.Free; except ; end;
>
> I always thought you were supposed to use Form.Release not
> Form.Free to handle any pending messages before closing (EG
> user clicked on the form during heavy processing leaving these
> click messages unprocessed whent he form is destroyed - which
> I think might raise an exception).

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to