Results 1 to 10 of 10

Thread: Moving Images With Transparency

  1. #1

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Marietta, GA.
    Posts
    32

    Question Moving Images With Transparency

    Hi, all...

    I've recenetly started a project where I need an image whose background is transparent (using the BitBlt technique), on top of of a non-transparent image that will move up and down the screen.

    Does anyone know a way to do this that is fast? I tried compositing the two images together and then drawing them to the form, but it's sooo slow (or either I wrote it really inefficient!).

    If anyone has any ideas, I'd appreciate any help! I'm kinda still new at this stuff, so please go moderately slow.

    - Amp
    Thanks!
    --AMP

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If you need a basic-intermediate-advanced tutorial go to mine:
    http://vbden.tripod.com/articles/invmask.htm

    Use Bitmasks, where all white pixels are BG and all black pictures are drawn (like a silhouette), make sure the corresponding pixels in this that are white are black on the real sprite picture.

    This will (hopefully) show you what you are looking for.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Marietta, GA.
    Posts
    32
    Ah, that explains it a lot clearer than what I've seen so far! Thanks so much!

    Now, all that's left is figure out how to put another image that can move freely up and down the screen behind the newly made transparent picture and I'll be set.

    - Amp
    Thanks!
    --AMP

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    That's easy; just change the blitting order. Blit the background first, then the thing that moves behind, then the normal sprite. PS. you can do only the first step of ANDing the mask to make a cool shadow...
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Oh! You mean just a background not another image, well, use SrcCopy constant, that will blit the rectangle of the bitmap (the whole sprite), the whole background.
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  6. #6

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Marietta, GA.
    Posts
    32
    Ah, thanks! It works great, and fast too! Thanks for your help!

    - Amp
    Thanks!
    --AMP

  7. #7
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    No problem
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  8. #8
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    Awwww Sas,

    You're just everyones hero!
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

  9. #9

    Thread Starter
    Member
    Join Date
    May 2000
    Location
    Marietta, GA.
    Posts
    32
    Mine at least.
    Thanks!
    --AMP

  10. #10
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Ain't it the truth

    So much attention

    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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