Forum > CustomDrawn

TForm.GetFormImage.SaveToFile returns a black window - LCLWidgetType=customdrawn


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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.Button1Click(Sender: TObject);begin  Form1.GetFormImage.SaveToFile('bitmapform.bmp');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.


Look at this page:

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.


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.

Using a recent Lazarus development snapshot and a recent fpgui snapshot downloaded using "git clone 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 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.


[0] Message Index

Go to full version