TransparentBlt_() is imported in 4.40 winx86

Everything else that doesn't fall into one of the other PB categories.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8453
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

TransparentBlt_() is imported in 4.40 winx86

Post by netmaestro »

Hurray! :D
BERESHEIT
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Re: TransparentBlt_() is imported in 4.40 winx86

Post by Mistrel »

If netmaestro is excited enough about this to make a post about it then it must be good! :D
dige
Addict
Addict
Posts: 1432
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: TransparentBlt_() is imported in 4.40 winx86

Post by dige »

wow, that must be really important .. never seen Netmeastro so excited before ;-)
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: TransparentBlt_() is imported in 4.40 winx86

Post by srod »

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.
User avatar
netmaestro
PureBasic Bullfrog
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

Post by netmaestro »

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
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: TransparentBlt_() is imported in 4.40 winx86

Post by srod »

Yes I thought that it affected only those old relics (Win 95 etc.) and so it's good for me! :wink:
I may look like a mule, but I'm not a complete ass.
citystate
Enthusiast
Enthusiast
Posts: 638
Joined: Sun Feb 12, 2006 10:06 pm

Re: TransparentBlt_() is imported in 4.40 winx86

Post by citystate »

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
User avatar
netmaestro
PureBasic Bullfrog
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

Post by netmaestro »

any chance for a code snippet showing how it can be used?
OK:

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
dige
Addict
Addict
Posts: 1432
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: TransparentBlt_() is imported in 4.40 winx86

Post by dige »

Oh, good to know - thx netmeastro
Post Reply