Page 1 of 1

Changed behavior correct? (#PB_2DDrawing_AllChannels)

Posted: Wed Apr 23, 2014 12:44 pm
by Joakim Christiansen
In a previous version I could draw transparent text like this onto a image where I needed to maintain the alpha channel:

Code: Select all

OpenWindow(0,0,0,200,100,"",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
ImageGadget(0,0,0,200,100,0)

CreateImage(0,200,100,24,#Gray) ;background
CreateImage(1,200,100,32,#PB_Image_Transparent) ;transparent image

StartDrawing(ImageOutput(1)) ;draw transparent image
  DrawingMode(#PB_2DDrawing_Transparent|#PB_2DDrawing_AllChannels)
  DrawText(5,5,"Transparent text")
StopDrawing()

StartDrawing(ImageOutput(0)) ;draw transparent image on background
  DrawAlphaImage(ImageID(1),0,0)
StopDrawing()

SetGadgetState(0,ImageID(0))

Repeat: Until WaitWindowEvent() = #PB_Event_CloseWindow
Now I need to use the #PB_2DDrawing_AlphaBlend mode instead of #PB_2DDrawing_AllChannels for this to work. So I wanted to know if this is the correct behavior or if it is a bug?