192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
BitBlt
Firstly, sorry about starting a thread for this, i know this sort of thing has been answered many times, but i just can not get it to work.
I'm making an tile based game editor. I'm currently bitblting the pictures on to the form, then using SRCAND to overlay the current object to place (which follows the cursor, and only changes the 'map' when the user clicks.
Instead of blending the images together i want to overlay the current object on top of the form.
As i already had all the SRCAND bitblt commands set up correctly, i decided to make a sub that instead of doing and, did a mask & picture.
Here is the Sub i'm using:
VB Code:
Public Sub MskBlt(DestDC, X, Y, Width, Height, SrcDC)
BitBlt DestDC, X, Y, Width, Height, SrcDC, Width, 0, SRCPAINT
BitBlt DestDC, X, Y, Width, Height, SrcDC, 0, 0, SRCAND
End Sub
All the parameters are the same as the ones i used for bitblt (which worked), except the last 3, which arn't needed any more.
The trouble is that this still blends the pictures together instead of overlaying them. What have i don't wrong?
Thanks for any replies.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
I sure did, infact i used your program to do so
For those who arn't familiar with Fox's brillient program, it created a bitmap, with the picture on the left, and the mask on the right (how i used it anyway).
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
Thanks for the reply, but i've already tried that already, and for some reason, it does nothing (nothing is drawn on the form).
I have checked the bitmap is in the correct place etc...
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
It's a black background.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
Uhm, however it should work.. make sure AutoRedraw of the picturebox holding your source bitmap is true or post the project..
Err I'm not sure whether my old MaskGen uses black or white backgrounds.. but if you're using Paint/And (as you do, the drawing code seems correct btw) the colored bitmap part needs a white background and the mask would have a black one...
192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
Ok, didn't want to resort to this, but here it is.
The sub is in the module (with a tempory solution so you can see what's going on), and all the code that calls it is in a procedure called RedrawArea (at the top).
When you run it, an open dialog will appear, choose test.gnr in the maps directory.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons
192.168.0.1 Preferred Animal: Penguin Reason for errors: Line#38
Posts
3,051
Great, that's fixed it. Thanks.
Quotes:
"I am getting better then you guys.." NoteMe, on his leet english skills.
"And I am going to meat her again later on tonight." NoteMe "I think you should change your name to QuoteMe" Shaggy Hiker, regarding NoteMe
"my sweet lord jesus. I've decided never to have breast implants" Tom Gibbons