Results 1 to 6 of 6

Thread: BitBlt - I'll get this bastard solved one day...

  1. #1

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    BitBlt - I'll get this bastard solved one day...

    I am having a **** of a time trying to use BitBlt.

    I understadn all the concepts of masking etc. but I am repeatedly having a problem where I put a new 'tile' over the old picture, the colours of the picture layers combine, where all I want is one to write over the other.

    I have a front picture box (white bg), a buffer picbox (black bg)
    The tiles I have tried drawing with black bg and white, and with a mask with black and white in alternating areas.

    First I paint the mask onto the back picbox, using vbSrcPaint
    Then I paint the sprite tile onto the back picbox with vbSrcAnd
    And finally, I vbSrcCopy the whole thing to the front picBox.

    No matter what combo I try, I can't seem to get this right...

    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Black Foreground White Background masks use SrcAnd, black background sprites use SrcPaint.
    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
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205
    I've discovered the source of my problem finally. It had nothing to do with the b/w order. I have it reversed - white background on sprites, black on masks, and that works now.

    The problem I had was arising from the fact that I split my sprite and mask into 2 separate .bmps. When I combined them again, it seemed to work.

    Why would that be happening? I thought BitBlt just did a pixel/bit transfer from one place to another, either as a direct copy or as a transformation, depending on the RasterOp.




    It works though, and that's what counts.
    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Too true =)
    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

    Thread Starter
    PowerPoster rjlohan's Avatar
    Join Date
    Sep 2001
    Location
    Sydney, Australia
    Posts
    3,205

    Red face I am a fool.

    SOLVED!!!

    Just call me a ****in idiot.

    I had my BitBlt calls set slightly wrong. The mask wasn't getting painted, as I still had the SourceX set to Tile.Width or some such stupidity.

    God damn.

    I hate silly **** like that, but it feels good to finally have this ***** working...

    -----------------------------------------
    -RJ
    [email protected]
    -----------------------------------------

  6. #6
    PowerPoster Arbiter's Avatar
    Join Date
    Sep 2000
    Location
    Manchester
    Posts
    2,276
    I normally find then when I can't get something to work - it isn't cos I don't understand the problem or the solution, just that I've made an INCREDIBLY stupid error - like blitting to the wrong place, or with the wrong image, or some such rubbish.

    Glad you solved it!
    Gentile or Jew,
    O you who turn the wheel and look to windward,
    Consider Phlebas, who was once handsome and tall as you...

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