Page 1 of 1

[Implemented] CreateImage transparent flag

Posted: Fri Sep 18, 2009 10:59 am
by mback2k
Please add a flag to CreateImage that allows us to get a blank transparent image instead of a black one, thanks.

Re: CreateImage transparent flag

Posted: Fri Sep 18, 2009 1:37 pm
by STARGĂ…TE

Code: Select all

Procedure CreateTransparentImage(Image, Width, Height)
  Protected Result = CreateImage(Image, Width, Height, 32)
  If Image = #PB_Any : Image = Result : EndIf
  If IsImage(Image)
   If StartDrawing(ImageOutput(Image))
    DrawingMode(#PB_2DDrawing_AlphaChannel)
    Box(0,0,ImageWidth(Image),ImageHeight(Image),$00000000)
    StopDrawing()
    ProcedureReturn Result
   EndIf
  EndIf
 EndProcedure