Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Win32API


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 19 December 1999 - 04:27 PM

I am trying to blit a part of the background to a picture box and then blit a mask and sprite over this picture box and then copy it all back to its original spot in the background. But whenever I do it, it copies a picture of a part of the previous form.
Here is the code:
If Player1 = "Ugly1" Then
ReturnValue = BitBlt(picWorkArea.hDC, 0, 0, picWorkArea.Width, picWorkArea.Height, picArena.hDC, 0, 0, SRCCOPY)
ReturnValue = BitBlt(picWorkArea.hDC, 0, 0, picWorkArea.Width, picWorkArea.Height, picUglyMask.hDC, 0, 0, SRCAND) ' SRCAND the sprite mask on top of the display section we copied
ReturnValue = BitBlt(picWorkArea.hDC, 0, 0, picWorkArea.Width, picWorkArea.Height, picUglyBlack.hDC, 0, 0, SRCPAINT) ' SRCPAINT the sprite on top of the mask and the display section
ReturnValue = BitBlt(picArena.hDC, 0, 0, picWorkArea.Width, picWorkArea.Height, picWorkArea.hDC, 0, 0, SRCCOPY) ' SRCCOPY the completed display section with transparent sprite back into the display picturebox
End If
Please help me

Sponsor:

#2 logistix   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 December 1999 - 02:56 PM

It looks like you need to save the original background somewhere. You're grabbing the background that already has a sprite drawn on it, if I'm following the code, you're just...

Getting background
blitting sprite

when you should...

paste old background
get background
copy background to old background
blit sprite

[This message has been edited by logistix (edited December 15, 1999).]


#3 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 19 December 1999 - 04:15 PM

I have almost gotten it to work but their is still a major bug. In the program you select an arena to play in and the characters to use from one form with thumbnails of them then when the maximized Game form comes up it is supposed to Blit in the background with the sprites of the characters. I am only currently blitting one character as I try and get it to work. One problem though: It blits the screen and then instead of blitting the mask and picture, it blits a semi transparent image of the form from which you select the wanted arena and characters.
What I am doing is this:

Place the background in a non visible picture box

Place the mask and picture in seperate non visible picture boxes

SRCCOPY the background to the visible picture box

SRCAND the mask to the visible picture box over the background

SRCPAINT the picture over the mask.

Please Help


#4 Anonymous Poster_Anonymous Poster_*   Guests   -  Reputation:

Likes

Posted 19 December 1999 - 04:27 PM

I forgot to say but if you want give me your e-mail address and I will send you the project, although you need vb6 for it to work!
Any help appreciated
CoolGuy





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS