Using the download above, try this. To avoid flicker you have to perform a double buffer with GDI. It envolves creating an "off screen" of virtual device context. You draw into this, then blt to your front dc (the client area).
I have managed to do this with some success, but have not managed to have flicker free gdi operations, overlaying the contents already in the client area.
;Example of drawing an arrow, double buffered
Include "skn3gdi.bb"
Global window = CreateWindow("test",100,100,800,700,0,1)
Global panel = CreatePanel(2,2,ClientWidth(window)-4,ClientHeight(window)-4,window)
Global timer = CreateTimer(60)
Global dcfront = CreateGadgetDc(panel)
Global dcback = CreateVirtualDc(ClientWidth(panel),ClientHeight(panel),dcfront)
Global brushcls = CreateRgbBrush(255,255,255)
Global brush = CreateRgbBrush(255,155,0)
Global pen = CreateRgbPen(0,0,0,1)
Repeat
Select WaitEvent()
Case $803 : Exit
Case $4001
SetDc DcBuffer(dcback)
SetPen pen
SetBrush brush
DrawRectFill(0,0,ClientWidth(panel),ClientHeight(panel),brushcls)
DrawArrow(ClientWidth(panel)/2,ClientHeight(panel)/2,GadgetMouseX(panel),GadgetMouseY(panel),18,66)
SetDc DcBuffer(dcfront)
DrawDc(dcback,gdi_bltmode_srccopy)
End Select
Forever
FreeDc(dcfront)
FreeBrush(brush)
FreeBrush(brushcls)
FreePen(pen)
|