Recent

Author Topic: TForm.GetFormImage.SaveToFile returns a black window - LCLWidgetType=customdrawn  (Read 1884 times)

lagprogramming

  • Full Member
  • ***
  • Posts: 193
I was curious about the status of customdrawn reason why in a linux-x86_64 OS I've put a TButton on an empty TForm and added the following code:
Code: Pascal  [Select][+][-]
  1. procedure TForm1.Button1Click(Sender: TObject);
  2. begin
  3.   Form1.GetFormImage.SaveToFile('bitmapform.bmp');
  4. end;
When LCLWidgetType is gtk2(default) the saved bitmap contains the actual form image, which is good. When LCLWidgetType is changed to customdrawn the saved bitmap contains a black image, which is not so good. Maybe it's not a big deal for the customdrawn developers to make it work.
 ;D

winni

  • Hero Member
  • *****
  • Posts: 3098
Hi!

Look at this page:

https://wiki.freepascal.org/Roadmap

Search for "Status of features on each LCL Interface"

Most of the items are marked as "Not implemented" or "Implemented in Android". Since a long time. I dont know if someone is working on customdraw.

Winni

lagprogramming

  • Full Member
  • ***
  • Posts: 193
The problem might be related to TForm or TBitmap implementations.
"Status of Graphics on each LCL Interface" shows that for customdrawn "TBitmap/TPixmap/TIcon/etc" is "working".
"Status of native controls on each LCL Interface" also shows that for customdrawn TForm is "working".
I notice that there's not much development for this widget type but the gtk and qt(probably fpgui too) developers had to implement the same functionality making their experience useful at fixing this faster than other developers. It's just an observation.

lagprogramming

  • Full Member
  • ***
  • Posts: 193
Using a recent Lazarus development snapshot and a recent fpgui snapshot downloaded using "git clone git://github.com/graemeg/fpgui.git fpgui-code" I wanted to know if the pascal code presented in the first post works as expected using the fpgui widgetset. Apparently the LCL implementation of fpgui is way back customdrawn, years I mean. When trying an empty form application I get an error in monitor.inc.TMonitor.GetPixelsPerInch at the first line: "if WidgetSet.GetDpiForMonitor(FHandle, MDT_EFFECTIVE_DPI, X, Y)=S_OK then..". Probably the situation is similar to the one presented in this forum at subject "How to use CustomDrawn on X11 Linux?".
If the fpgui developers decide to update their code in order to build an application according to the first post, maybe they would also try to update customdrawn widgedset. At OS level it might be the same issue.

 

TinyPortal © 2005-2018