Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21314

BitBlt issue smearing the character on a moving background...

$
0
0
I made visible the Character and CharacterMask for referencing
Name:  smear2.jpg
Views: 93
Size:  79.1 KB

VB6
Windows 7

I am using BitBlt to move the map behind the character. I am also using BitBlt to draw the character. The character is animating (running). So, to keep the character centered, I am having to continually adjust the X and Y of the character, which is not the problem. The problem is the smearing I am getting. The code is in a Timer:

Code:

If (timerMapMover.Tag = "NORTH") And (MoveMapY < 0) Then
    MoveMapY = MoveMapY + 1
    myCharacter.Picture = LoadResPicture("NORTH" & MyAni, 0)
    MakeMask myCharacter, myCharacterMask, CLng(vbBlack), CLng(vbWhite), CLng(vbBlack)
    BltTheCharacter myBuffer, myCharacter, myCharacterMask, ConvertTwipsToPixelsX(Me.Width / 2) - MoveMapX, ConvertTwipsToPixelsY(Me.Height / 2) - MoveMapY
    BltFinal myStage, myBuffer, MoveMapX, MoveMapY
End If

myCharacter is my Hero
myCharacterMask is the masked version of my Hero
myBuffer is the buffer PictureBox
myStage is where everything is BitBlt'd once it is all combined in the buffer

Obviously I am moving North, therefore the map is moving down to give the appearance of the character moving North.
I am using images loaded in a .res file.
MakeMask calls a routine to create the mask.

What am I missing to clear up the smearing issue?
Attached Images
 

Viewing all articles
Browse latest Browse all 21314

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>