Code: Select all
CreateImage(0,600,600,32)
StartDrawing(ImageOutput(0))
For i = 0 To 100
DrawingMode(#PB_2DDrawing_AllChannels )
alpha = Random(255,0)
Circle(Random(600,10),Random(600,10),Random(50,10),RGBA(255,0,0,alpha))
Next
StopDrawing()
CreateImage(1,600,600,32)
StartDrawing(ImageOutput(1))
For i = 0 To 100
DrawingMode(#PB_2DDrawing_AllChannels )
alpha = Random(255,0)
Circle(Random(600,10),Random(600,10),Random(50,10),RGBA(0,255,0,alpha))
Next
StopDrawing()
CreateImage(2,600,600,32)
StartDrawing(ImageOutput(2))
For i = 0 To 100
DrawingMode(#PB_2DDrawing_AllChannels )
alpha = Random(255,0)
Circle(Random(600,10),Random(600,10),Random(50,10),RGBA(0,0,255,alpha))
Next
StopDrawing()
OpenWindow(0, 0, 0, 600, 600, "2D Drawing Test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
If CreateImage(100, 1200, 1200 ,32)
If StartDrawing(ImageOutput(100))
DrawingMode(#PB_2DDrawing_AllChannels )
DrawImage(ImageID(0),0,0,600,600)
DrawImage(ImageID(1),600,0,600,600)
For x = 0 To 599
For y = 0 To 599
c1 = Point(x,y)
c2 = Point(x+600,y)
color = AlphaBlend(c1,c2)
Plot(x,y+600,color)
Next
Next
GrabDrawingImage(3,0,600,600,600)
StopDrawing()
EndIf
EndIf
If CreateImage(100, 1200, 1200 ,32)
If StartDrawing(ImageOutput(100))
DrawingMode(#PB_2DDrawing_AllChannels )
DrawImage(ImageID(3),0,0,600,600)
DrawImage(ImageID(2),600,0,600,600)
For x = 0 To 599
For y = 0 To 599
c1 = Point(x,y)
c2 = Point(x+600,y)
color = AlphaBlend(c1,c2)
Plot(x,y+600,color)
Next
Next
GrabDrawingImage(4,0,600,600,600)
StopDrawing()
EndIf
EndIf
ImageGadget(0, 0, 0, 600,600, ImageID(4))
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
End