Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2014-05

GetFormImage bug

4 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Chris Crori

Hi guys,
I am not very sure on how I can describe this...

I have a thumbnail section in my main program form. In the forms, I use GetFormImage to make an image and send it to the mainform. The bug is that some components are not visible in this image. TDBGrid is one and a custom component derived from TBitBtn is another.

I use the latest stable Lazarus 1.2.2 with FPC 2.6.4 on windows7, both 32 and 64 bit

Regards,

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140513/c1b71352/attachment.html>

Reply by email

Howard Page-Clark
to Chris Crori
Chris Crori wrote 6 lines
I have a thumbnail section in my main program form. In the forms, I use GetFormImage to make an image and send it to the mainform. The bug is that some components are not visible in this image. TDBGrid is one and a custom component derived from TBitBtn is another. I use the latest stable Lazarus 1.2.2 with FPC 2.6.4 on windows7, both 32 and 64 bit
This method
//---------
procedure TForm1.Button1Click(Sender: TObject);
var
   bmp: TBitmap;
begin
   form2.Show;
   bmp:=form2.GetFormImage;
   try
     Image1.Canvas.StretchDraw(Image1.ClientRect, bmp);
   finally
     bmp.Free;
   end;
end;
//---------
shows a DBGrid (and everything else I dropped on form2) nicely on my
Win7 32bit setup.
Perhaps you need to share the code that drops parts of the bitmap (and
perhaps the lfm of the imaged form as well).

Reply by email

Chris Crori
to Howard Page-Clark

Since the problem is in my code I will try to figure it out and report any results. The system is a bit complex to post everything, but the basics are the same. If I fail in this I will try to duplicate the problem in smaller forms, so I can post a bug report

Thanks for testing Howard :)

Earlier message 34 lines
From: Howard Page-Clark Sent: Tuesday, May 13, 2014 7:44 PM To: Subject: Re: [Lazarus] GetFormImage bug On 13/05/2014 16:49, Chris Crori wrote: > I have a thumbnail section in my main program form. In the forms, I use > GetFormImage to make an image and send it to the mainform. > The bug is that some components are not visible in this image. > TDBGrid is one and a custom component derived from TBitBtn is another. > I use the latest stable Lazarus 1.2.2 with FPC 2.6.4 on windows7, both > 32 and 64 bit This method //--------- procedure TForm1.Button1Click(Sender: TObject); var bmp: TBitmap; begin form2.Show; bmp:=form2.GetFormImage; try Image1.Canvas.StretchDraw(Image1.ClientRect, bmp); finally bmp.Free; end; end; //--------- shows a DBGrid (and everything else I dropped on form2) nicely on my Win7 32bit setup. Perhaps you need to share the code that drops parts of the bitmap (and perhaps the lfm of the imaged form as well). --

Reply by email

Chris Crori
to Howard Page-Clark: This method //--------- procedure TForm1.Button1Click(Sender: TObject); var bmp: TBitmap;…

In this project, speedbuttons and bitbuttons work fine, but TDBGrid does not show. If it is visible in your computer, maybe there is something that can go wrong with display drivers?

Press the right button to create the form and left (button1) to refresh the Preview

Earlier message 34 lines
From: Howard Page-Clark Sent: Tuesday, May 13, 2014 7:44 PM To: Subject: Re: [Lazarus] GetFormImage bug On 13/05/2014 16:49, Chris Crori wrote: > I have a thumbnail section in my main program form. In the forms, I use > GetFormImage to make an image and send it to the mainform. > The bug is that some components are not visible in this image. > TDBGrid is one and a custom component derived from TBitBtn is another. > I use the latest stable Lazarus 1.2.2 with FPC 2.6.4 on windows7, both > 32 and 64 bit This method //--------- procedure TForm1.Button1Click(Sender: TObject); var bmp: TBitmap; begin form2.Show; bmp:=form2.GetFormImage; try Image1.Canvas.StretchDraw(Image1.ClientRect, bmp); finally bmp.Free; end; end; //--------- shows a DBGrid (and everything else I dropped on form2) nicely on my Win7 32bit setup. Perhaps you need to share the code that drops parts of the bitmap (and perhaps the lfm of the imaged form as well). --

Reply by email