Thanks for the answers!
What you can do is to save the memory bitmap to file with one of the SaveBitmapAsxxx methods and then load it to the image control.
This is extremely ineffective when animating a drawing dynamically.
This means that in the visual editor WinFBE users are deprived of an easy way to create a work surface and draw something on it. I understand correctly?
If this is the case, then this is certainly upsetting, because I was very happy with how easy it is in WinFBE to interact between the created controls.
Everything is done so well that almost all the work is done by WinFBE, all that remains is to add a few lines of event handling code.
Of course, it won't be difficult to create your own drawing surface right in the code (for example, the same Static control).
And draw on it without any problems using GDI or GDI+ (e.g. by timer), as well as send Bitmap GDI there directly using SendMessage (STM_SETIMAGE).
I confess I thought that in WinFBE | WinFBX this is how is implemented, but it looks like some other method is applied there.
For example:
dim shared as HWND winStatic
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
winStatic = CreateWindowEx(WS_EX_CLIENTEDGE, "static", 0, WS_CHILD Or WS_VISIBLE Or SS_ICON, 10,10,150,150, sender.hWindow , Cast(HMENU,1), 0, 0)
Using GDIPLUS
Dim ULONG_PTR_01 AS ULONG_PTR
DIM GDIPLUSSTARTUPINPUT_01 AS GDIPLUSSTARTUPINPUT
GDIPLUSSTARTUPINPUT_01.GdiplusVersion = 1
IF (GDIPLUSSTARTUP(@ULONG_PTR_01, @GDIPLUSSTARTUPINPUT_01, NULL) <> 0) THEN
PRINT "FAIL"
EndIf
Function = 0
End Function
''
''
Function frmMain_Timer1_Elapsed( ByRef sender As wfxTimer, ByRef e As EventArgs ) As LRESULT
Dim As PVOID GPIMAGE_01 , GpGraphics , GpGraphics2
Dim pen As GpPen Ptr
GdipCreateFromHWND( winStatic ,@GpGraphics2)
GdipCreateBitmapFromScan0(150,150, 0, PixelFormat32bppARGB, NULL, @GPIMAGE_01)
GdipGetImageGraphicsContext(GPIMAGE_01,@GpGraphics)
GdipCreatePen1(&hFF0000FF,3,Unitpixel,@pen)
GdipDrawLine(GpGraphics,pen , 5, 5, 140, 140)
GdipDrawImage(GpGraphics2,GPIMAGE_01,0,0)
GdipDeletePen(pen)
GdipDeleteGraphics(GpGraphics)
GdipDeleteGraphics(GpGraphics2)
GdipDisposeImage(GPIMAGE_01)
Function = 0
End Function
Also, GDI and GDI + images can be easily converted to each other using GdipCreateHBITMAPFromBitmap , GdipCreateBitmapFromHBITMAP.
José, Paul , I hope in the future you will supplement the editor with some element for dynamic drawing, and dynamic loading of images directly from memory.