Transparent shadow image as window's background?
Posted: Mon Dec 03, 2007 12:06 pm
When I set transparent shadow image as window's background, I couldn't
alignment any gadgets inside the window. Any solution will be appreciated.
CreateGadgetList(WindowID(0))
ButtonGadget(1,20,20,100,50,"Button")
The button doesn't visible in the following code.
Here is the image : ftp://leon.serveftp.net/ftp/BG.png
alignment any gadgets inside the window. Any solution will be appreciated.
CreateGadgetList(WindowID(0))
ButtonGadget(1,20,20,100,50,"Button")
The button doesn't visible in the following code.
Here is the image : ftp://leon.serveftp.net/ftp/BG.png
Code: Select all
UsePNGImageDecoder()
Global WorkDir.s = ""
WorkDir.s = Space(1000)
GetCurrentDirectory_(1000,@WorkDir)
WorkDir = WorkDir + "\"
OpenWindow(0, 0, 0, 512, 384, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
SetWindowLong_(WindowID(0), #GWL_EXSTYLE, GetWindowLong_(WindowID(0), #GWL_EXSTYLE) | #WS_EX_LAYERED)
CreateGadgetList(WindowID(0))
LoadImage(0, WorkDir +"BG.png")
CreateGadgetList(WindowID(0))
ButtonGadget(1,20,20,100,50,"Button")
hdc = StartDrawing(ImageOutput(0))
GetObject_(ImageID(0), SizeOf(BITMAP), @BitmapInfo.BITMAP)
ContextOffset.POINT
BlendMode.BLENDFUNCTION
BlendMode\SourceConstantAlpha = 255
BlendMode\AlphaFormat = 1
UpdateLayeredWindow_(WindowID(0), 0, 0, @BitmapInfo+4, hdc, @ContextOffset, 0, @BlendMode, 2)
StopDrawing()
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver