[Lazarus] TForm.GetFormImage is broken?

Fabio Luis Girardi fluisgirardi at gmail.com
Mon Dec 26 21:08:23 CET 2016


It worked. Thanks!

Why is necessary to call the TCanvas.Changed after TForm1.GetFormImage?

2016-12-26 17:58 GMT-02:00 Balázs Székely <getmem1 at gmail.com>:

> Hi,
>
> Am I using the method GetFormImage right?
>>
> Yes,
>
>
> Should I fill a bug report for this issue?
>>
> No.
>
> Please try this:
> var
>   bmp: TBitmap;
> begin
>   bmp:=Form1.GetFormImage;
>   try
>     *bmp.Canvas.Changed;*
>     bmp.SaveToFile(ExtractFilePath(Application.ExeName)+'form.bmp');
>   finally
>     FreeAndNil(bmp);
>   end;
> end;
>
> On Mon, Dec 26, 2016 at 9:38 PM, Fabio Luis Girardi via Lazarus <
> lazarus at lists.lazarus-ide.org> wrote:
>
>> Hi!
>>
>> Currently I'm trying to use TForm.GetFormImage method to make a minimap
>> (something similar to Sublime Text editor) of a big form (the parent of
>> this big form is a TScrollbox on this application).
>>
>> But, using Qt or GTK2, Lazarus 1.6.3 or trunk, I got the same black
>> bitmap.
>>
>> So, I created a empty application (just one form with some buttons) and
>> the result is the same.
>>
>> The code that should make a screenshot of my form is:
>>
>> procedure TForm1.Button3Click(Sender: TObject);
>> var
>>   bmp: TBitmap;
>> begin
>>   bmp:=Form1.GetFormImage;
>>   try
>>     bmp.SaveToFile(ExtractFilePath(Application.ExeName)+'form.bmp');
>>   finally
>>     FreeAndNil(bmp);
>>   end;
>> end;
>>
>> Am I using the method GetFormImage right?
>>
>> If yes, what's the alternative method to make a screenshot of a form?
>>
>> Should I fill a bug report for this issue?
>>
>> --
>> The best regards,
>>
>> Fabio Luis Girardi
>> PascalSCADA Project
>> http://sourceforge.net/projects/pascalscada
>> http://www.pascalscada.com
>>
>> --
>> _______________________________________________
>> Lazarus mailing list
>> Lazarus at lists.lazarus-ide.org
>> http://lists.lazarus-ide.org/listinfo/lazarus
>>
>>
>


-- 
The best regards,

Fabio Luis Girardi
PascalSCADA Project
http://sourceforge.net/projects/pascalscada
http://www.pascalscada.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161226/ecb6649b/attachment.html>


More information about the Lazarus mailing list