FillMemory

Just starting out? Need help? Post your questions and find answers here.
mestnyi
Addict
Addict
Posts: 1000
Joined: Mon Nov 25, 2013 6:41 am

FillMemory

Post by mestnyi »

in macos fillmemory clears the canvas and sets the transparency and it works very well, is it possible to make it so that both Windows and Linux have the same behavior.

Code: Select all

Global BackgroundColor, img = LoadImage( #PB_Any, #PB_Compiler_Home + "examples/sources/Data/Geebee2.bmp" ) 
Global hole = CreateImage( #PB_Any,100,100,32 )

If StartDrawing( ImageOutput( hole ) )
  DrawingMode( #PB_2DDrawing_AllChannels )
  Box( 0,0,OutputWidth(),OutputHeight(),RGBA( $00,$00,$00,$00 ) )
  Circle( 50,50,48,RGBA( $00,$FF,$FF,$FF ) )
  Circle( 50,50,30,RGBA( $00,$00,$00,$00 ) )
  StopDrawing( )
EndIf

Global alpha = 45
OpenWindow(0, 0, 0, 300, 300, "Test", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SetWindowColor(0, $C0AED7F2)

StartDrawing(WindowOutput(0))
BackgroundColor = Point(0, 0)
StopDrawing()

ButtonGadget(10, 10, 10, 280, 80, "button")
CanvasGadget(0, 10, 10, 280, 280)

If StartDrawing( CanvasOutput( 0 ) )
  FillMemory( DrawingBuffer( ), DrawingBufferPitch( ) * OutputHeight( ), alpha )
  
  DrawingMode( #PB_2DDrawing_Default )
  ;DrawingMode( #PB_2DDrawing_AlphaBlend )
   
  DrawImage( ImageID( Img ),50,50 )
  DrawImage( ImageID( hole ),130,130 )
  StopDrawing( )
EndIf

Repeat
  Event = WaitWindowEvent()
  
  Select Event
    Case #PB_Event_CloseWindow
      Exit = #True
  EndSelect
  
Until Exit
Last edited by mestnyi on Sun Jun 06, 2021 4:01 pm, edited 1 time in total.
User avatar
idle
Always Here
Always Here
Posts: 5096
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: FillMemory

Post by idle »

I didn't notice any difference?
Post Reply