Results 1 to 6 of 6

Thread: [Resolved] Blit this foo! (Transparency Stuff)

  1. #1

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    [Resolved] Blit this foo! (Transparency Stuff)

    I tried writing a TransBlt function, but it doesn't really work...

    VB Code:
    1. Private Sub TransBlt(hPicture As Long, iFromX As Integer, iFromY As Integer, _
    2.   hMask As Long, iFromMaskX As Integer, iFromMaskY As Integer, hTo As Long, _
    3.   x As Integer, y As Integer, iWidth As Integer, iHeight As Integer)
    4.  
    5.   BitBlt hTo, x, y, iWidth, iHeight, hPicture, iFromX, iFromY, vbSrcPaint
    6.   BitBlt hTo, x, y, iWidth, iHeight, hMask, iFromX, iFromY, vbSrcAnd
    7. End Sub

    Where am I going wrong?
    Last edited by The Hobo; Nov 18th, 2002 at 06:47 PM.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  2. #2

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Nevermind. I found the problem already. I was blitting the picture before the mask.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  3. #3
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    hey! i tried that code (fixed it first) but something was wrong...
    were it was supposed to be transparent, it changed the color of the BG....why?
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  4. #4
    Frenzied Member cyborg's Avatar
    Join Date
    May 2000
    Location
    Sweden
    Posts
    1,755
    oh! nevermin this too...
    i just changed the bg color of the pic to black, and it worked...
    Check out the FAQ and do a search before you post.
    My tutorials: Anti-Alias Pixels, Accurate Game Loop, Resource File

  5. #5
    Addicted Member jmiller's Avatar
    Join Date
    Jul 2002
    Location
    University of Michigan
    Posts
    238
    theres a api function called transparantblt too

  6. #6

    Thread Starter
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by jmiller
    theres a api function called transparantblt too
    However, it caused bad memory leaks on most operating systems and is only available in OS > 95.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width