Example
Here's a first start, but how to tune this a little bit more?
Code: Select all
Enumeration
#ImageGadget
#ImageBackground
#ImageGlass
EndEnumeration
PixelSize=256
#DrawOpaque=$FF000000
OpenWindow(0,0,0,PixelSize*2,PixelSize,"Glas")
ImageGadget(#ImageGadget,0,0,PixelSize*2,PixelSize,0)
CreateImage(#ImageGadget,PixelSize*2,PixelSize,32,#PB_Image_Transparent)
For ScreenType=0 To 1
; Initializing "empty" image... (is there a shorter way for doing this?)
; CreateImage(#ImageGlass,PixelSize,PixelSize,32,#PB_Image_Transparent)
CreateImage(#ImageGlass,PixelSize,PixelSize,32,#White)
StartDrawing(ImageOutput(#ImageGlass))
DrawingMode(#PB_2DDrawing_AlphaChannel)
Box(0,0,PixelSize,PixelSize,#White)
StopDrawing()
; Create highlighted area
StartVectorDrawing(ImageVectorOutput(#ImageGlass))
If ScreenType
AddPathCircle(PixelSize/2,PixelSize/2,PixelSize/2)
ClipPath()
EndIf
MovePathCursor(0,0,#PB_Path_Default)
AddPathLine(PixelSize,0,#PB_Path_Default)
AddPathLine(PixelSize,PixelSize/3,#PB_Path_Default)
AddPathArc(PixelSize/4,PixelSize/6,0,PixelSize*0.75,PixelSize)
AddPathLine(0,PixelSize*0.75,#PB_Path_Default)
ClosePath()
VectorSourceLinearGradient(0,0,0,PixelSize)
VectorSourceGradientColor($70ffffff,1.0); $80ffffff
VectorSourceGradientColor($30ffffff,0.0) ; $50ffffff
FillPath()
StopVectorDrawing()
; Background
CreateImage(#ImageBackground,PixelSize*2,PixelSize,32,#PB_Image_Transparent)
StartDrawing(ImageOutput(#ImageBackground))
DrawingMode(#PB_2DDrawing_AllChannels)
If ScreenType
Circle(PixelSize/2,PixelSize/2,PixelSize/2,#DrawOpaque|#Blue)
Else
Box(0,0,PixelSize,PixelSize,#DrawOpaque|#Blue)
EndIf
; Dont' use this effect now...
;For i=0 To 9999
; x=Random(PixelSize-1)
; y=Random(PixelSize-1)
; c=Random(50)
; Circle(x,y,2,Point(x,y)!($10101*c))
;Next i
StopDrawing()
; Merge background with glossy effect...
StartDrawing(ImageOutput(#ImageGadget))
DrawAlphaImage(ImageID(#ImageBackground),PixelSize*ScreenType,0)
DrawAlphaImage(ImageID(#ImageGlass),PixelSize*ScreenType,0)
StopDrawing()
Next ScreenType
SetGadgetState(#ImageGadget,ImageID(#ImageGadget))
Repeat : Select WaitWindowEvent() : Case #PB_Event_CloseWindow,#WM_CHAR : End : EndSelect : ForEver