Procedure Drawing(Image.l)
UseImage (Image)
If StartDrawing ( ImageOutput ())
Box (0, 0, ImageWidth (), ImageHeight (), RGB (255, 255, 255))
Ellipse (100, 100, 100, 100, 0)
StopDrawing ()
EndIf
EndProcedure
Picture = CreateImage ( #PB_Any , 200, 200)
If OpenWindow (0, #CW_USEDEFAULT , #CW_USEDEFAULT , 200, 200, #PB_Window_SystemMenu , "Drawing" )
If CreateGadgetList ( WindowID (0))
ImageGadget (0, 0, 0, 200, 200, Picture)
EndIf
Drawing(Picture)
SetGadgetState (0, UseImage (Picture))
Repeat
Select WaitWindowEvent ()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf
Oder mit Bild:
Code: Alles auswählen
Procedure Drawing(Image.l)
UseImage(Image)
If StartDrawing(ImageOutput())
Box(0, 0, 100, 100, RGB(255, 255, 255))
Ellipse(100, 100, 100, 100, 0)
StopDrawing()
EndIf
EndProcedure
;Picture = CreateImage(#PB_Any, 200, 200)
Picture = LoadImage(#PB_Any, "MeinBild.bmp")
If OpenWindow(0, #CW_USEDEFAULT, #CW_USEDEFAULT, 200, 200, #PB_Window_SystemMenu, "Drawing")
If CreateGadgetList(WindowID(0))
ImageGadget(0, 0, 0, 200, 200, Picture)
EndIf
Drawing(Picture)
SetGadgetState(0, UseImage(Picture))
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
EndIf
Das Original kannste auch mit CopyImage sichern, um es vorm ändern der Zeichnung wieder zurückzukopieren.