Replies: 5 comments 6 replies
-
@rchastain : In one of your explorations you found an MSEgui feature of TWindow but I can't seem to find it. I think that we have the keys to make MSEgui totally universal. |
Beta Was this translation helpful? Give feedback.
-
Hello everybody. Finally I find a way to save the canvas of a form, with all his child-components into a png file (or/and bitmap). Here the trick (thanks to the wonderful BGRABitmap gem):
Here zip file demo: |
Beta Was this translation helpful? Give feedback.
-
Hello Roland. I try to find the imperfection with the form saved from a screenshot vs from form2file() but, apart the decorations that of course are not rendered with form2file(), I dont see it. Please show me what I miss. (Ha, ok, there is the "B" of "Boolean edit" that is not perfect. For the button "Save form to file", the frame is not the same but that is because form2file() was called after button.onexecute.) |
Beta Was this translation helpful? Give feedback.
-
Here zoom 4x of "Boolean edit" text. Strange.... |
Beta Was this translation helpful? Give feedback.
-
The solution is to add a black background: var
btmp, btmp2: tbgrabitmap;
// ...
begin
btmp := tbgrabitmap.Create(Width, Height);
btmp2 := tbgrabitmap.Create(Width, Height, BGRABlack);
// ...
btmp.Canvas.copyarea(getcanvas, r, p);
btmp2.PutImage(0, 0, btmp, dmDrawWithTransparency);
btmp2.savetofile('aBitmap.png'); |
Beta Was this translation helpful? Give feedback.
-
There is a topic on Lazarus forum about save forms to bitmaps with MSEgui:
https://forum.lazarus.freepascal.org/index.php/topic,64187.msg487549.html#msg487549
This is the comment:
Have a look at MSEide/MSEgui. For now it can't do that either but compared to LCL's customdrawn, MSEgui is much closer to achieving that.
https://github.com/mse-org/mseide-msegui
Unfortunately, at the moment, unlike LCL, MSEgui is not able to save forms to bitmaps, which is something very important for MSEgui. Much more important than it is for LCL.
It seems to me that it was already asked but cannot remember.
Is it possible to save forms to bitmaps?
Sure with a capture-screen and select a position it is possible but it seems they want something else.
Beta Was this translation helpful? Give feedback.
All reactions