Does work here (but only with the parameter #PB_Long), anyhow the additional Start/StopDrawing does need some time. Actually I am working with Case 0 of the source code below...
Code: Select all
#BrushSize= 29
#BrushCenter= #BrushSize/2
#Zoom= 10*#BrushSize
#DrawOpaque= $ff000000
#ImgPat= 0
OpenWindow(0,0,0,#Zoom,#Zoom,"")
CreateImage(#ImgPat,#BrushSize,#BrushSize,32,#PB_Image_Transparent)
Select 3
Case 0
bitmap.Bitmap
GetObject_(ImageID(#ImgPat),SizeOf(BITMAP),@bitmap)
FillMemory(bitmap\bmBits,bitmap\bmWidthBytes * bitmap\bmHeight,#White)
Debug PeekL(bitmap\bmBits)
Case 1
StartDrawing(ImageOutput(#ImgPat))
z=DrawingBuffer()
y=DrawingBufferPitch() * OutputHeight()
FillMemory(z,y,#White)
FillMemory(z,y,#Red)
StopDrawing()
Debug PeekL(z)
Case 2
StartDrawing(ImageOutput(#ImgPat))
z=DrawingBuffer()
y=DrawingBufferPitch() * OutputHeight()
StopDrawing()
FillMemory(z,y,#White)
FillMemory(z,y,#Red)
Debug PeekL(z)
Case 3
StartDrawing(ImageOutput(#ImgPat))
DrawingMode(#PB_2DDrawing_AllChannels)
Box(0,0,#BrushSize,#BrushSize,#White)
Debug PeekL(DrawingBuffer())
StopDrawing()
EndSelect
StartVectorDrawing(ImageVectorOutput(#ImgPat))
If 0
VectorSourceColor($80000000|#Red)
FillVectorOutput()
EndIf
;VectorSourceColor(#White)
;FillVectorOutput()
#C1= #White
#C2= $800000
d.d=50
f.d=100/d
d=f/2
VectorSourceCircularGradient(#BrushCenter-f*3,#BrushCenter-f*3,1+5*d)
VectorSourceGradientColor(#DrawOpaque|#C1, 0.0)
VectorSourceGradientColor(#DrawOpaque|#C1, 0.9)
VectorSourceGradientColor(#C1, 1.0)
AddPathCircle(#BrushCenter-f*3,#BrushCenter-f*3,1+5*d)
FillPath()
AddPathCircle(#BrushCenter+f*3,#BrushCenter+f*3,1+5*d)
VectorSourceColor(#DrawOpaque|#C1)
FillPath()
StopVectorDrawing()
;ShowLibraryViewer("image",#ImgPat)
SetWindowColor(0,$f0e080)
ResizeImage(#ImgPat,#Zoom,#Zoom,#PB_Image_Raw)
ImageGadget(0,0,0,#Zoom,#Zoom,ImageID(#ImgPat))
Repeat : Until WaitWindowEvent()=#PB_Event_CloseWindow