TransparentBlt_() is imported in 4.40 winx86
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: TransparentBlt_() is imported in 4.40 winx86
If netmaestro is excited enough about this to make a post about it then it must be good! 
Re: TransparentBlt_() is imported in 4.40 winx86
wow, that must be really important .. never seen Netmeastro so excited before 
Re: TransparentBlt_() is imported in 4.40 winx86
Isn't that API buggy? I mean I read somewhere (on these forums I think) that the function can yield a memory leak on some systems.
I may look like a mule, but I'm not a complete ass.
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: TransparentBlt_() is imported in 4.40 winx86
The memory leak only affected Win95 and 98. For my part, I stopped trying to write code that will run on those dinosaurs about three years ago. So for me, it isn't an issue. What is an issue imho is that it is five times faster (no exaggeration) than any alternatives I've seen. And for XP/2000 and up it's solid.
BERESHEIT
Re: TransparentBlt_() is imported in 4.40 winx86
Yes I thought that it affected only those old relics (Win 95 etc.) and so it's good for me! 
I may look like a mule, but I'm not a complete ass.
Re: TransparentBlt_() is imported in 4.40 winx86
any chance for a code snippet showing how it can be used?
there is no sig, only zuul (and the following disclaimer)
WARNING: may be talking out of his hat
WARNING: may be talking out of his hat
- netmaestro
- PureBasic Bullfrog

- Posts: 8453
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: TransparentBlt_() is imported in 4.40 winx86
OK:any chance for a code snippet showing how it can be used?
Code: Select all
If FileSize(GetTemporaryDirectory()+"girlonchair.bmp") = -1
InitNetwork()
If Not ReceiveHTTPFile("http://www.lloydsplace.com/girlonchair.bmp", GetTemporaryDirectory()+"girlonchair.bmp")
MessageRequester("oops...","Couldn't get image - ending",#MB_ICONERROR)
EndIf
EndIf
; If we're still here, we have the image in our temp directory
img = LoadImage(#PB_Any, GetTemporaryDirectory()+"girlonchair.bmp")
w=ImageWidth(img)
h=ImageHeight(img)
OpenWindow(0, 0, 0, 640, 480, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
x=WindowWidth(0)/2-w/2
y=WindowHeight(0)/2-h/2
Repeat
EventID = WaitWindowEvent()
Select EventID
Case #PB_Event_Repaint
hDC_Out = StartDrawing(WindowOutput(0))
hDC_In = CreateCompatibleDC_(#Null)
oldimg = SelectObject_(hDC_In, ImageID(img))
TransparentBlt_(hDC_Out,x,y,w,h,hDC_In,0,0,w,h,#White)
SelectObject_(hDC_In, oldimg)
DeleteDC_(hDC_In)
StopDrawing()
EndSelect
Until EventID = #PB_Event_CloseWindow
BERESHEIT
Re: TransparentBlt_() is imported in 4.40 winx86
Oh, good to know - thx netmeastro

