-
Jan 15th, 2014, 02:28 PM
#1
Thread Starter
Addicted Member
-
Jan 15th, 2014, 03:03 PM
#2
Re: BitBlt issue smearing the image...
I've had that problem using BitBlt and moving the object manually by mouse down on object and moving the mouse pointer but the smearing stops (picture returns to normal) when the movement stops. Also I don't think you should have AutoRedraw = True; that causes too much overhead. Try using False when you move the object. In my case if I remember it was because the picture was either too big and/or using wrong scale mode or I had AutoRedraw = True.
Last edited by jmsrickland; Jan 15th, 2014 at 03:11 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jan 15th, 2014, 03:18 PM
#3
Thread Starter
Addicted Member
Re: BitBlt issue smearing the image...
Setting AutoRedraw to True blanks out the image. For BitBlt to work, all PictureBoxes need to have AutoRedraw set to True except the final PictureBox where everything ends up. Stopping the movement (I'm using a Timer) does nothing for the final image. The image is 240x144 pixels, so the size isn't the issue. And the scale I am using works for everything else, so I know that's not it.
-
Jan 15th, 2014, 03:53 PM
#4
Re: BitBlt issue smearing the image...
Originally Posted by Conroy Vanderbluff
Setting AutoRedraw to True blanks out the image. For BitBlt to work, all PictureBoxes need to have AutoRedraw set to True except the final PictureBox where everything ends up. Stopping the movement (I'm using a Timer) does nothing for the final image. The image is 240x144 pixels, so the size isn't the issue. And the scale I am using works for everything else, so I know that's not it.
So, set it to False
EDIT: I think you need to save the rectangle where you are moving to. Then move to that. When you move away restore the area you saved and do this again. What's happening is you are leaving a trail behind you as you BitBlt to a new position
Last edited by jmsrickland; Jan 15th, 2014 at 08:04 PM.
Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.
-
Jan 15th, 2014, 04:17 PM
#5
Thread Starter
Addicted Member
Re: BitBlt issue smearing the image...
Originally Posted by Conroy Vanderbluff
All of my PictureBoxes have AutoRedraw set to True except my final PictureBox.
It was originally.
-
Jan 15th, 2014, 04:24 PM
#6
Thread Starter
Addicted Member
Re: BitBlt issue smearing the image...
Let me reiterate; whether the AutoRedraw is set to True or False, it doesn't work. One blanks out the image entirely, while the other smears it.
-
Jan 15th, 2014, 07:06 PM
#7
Re: BitBlt issue smearing the image...
Assuming you're bitblting the map from some other source, if you don't clear the exposed area (the area that you are not bitblitting the map to), then of course you are going to see the one pixel band vertically and horizontally of the map left side and top line replicated as you move the map down to the right.
Any part of the buffer you don't draw to is going to have the previous contents of the buffer unless you clear the buffer first.
Last edited by passel; Jan 15th, 2014 at 07:11 PM.
-
Jan 15th, 2014, 08:09 PM
#8
Re: BitBlt issue smearing the image...
Originally Posted by passel
Assuming you're bitblting the map from some other source, if you don't clear the exposed area (the area that you are not bitblitting the map to), then of course you are going to see the one pixel band vertically and horizontally of the map left side and top line replicated as you move the map down to the right.
Any part of the buffer you don't draw to is going to have the previous contents of the buffer unless you clear the buffer first.
This is exactly what is happening. He needs to find something to draw to the space it moved from. It looks like his tile is smaller than the actual map so he actually has nothing to draw. I think Jacob Roman may have done something like this since he writes a lot of game related stuff. Try PMing him to this thread. He might have some experience with this exact scenario.
-
Jan 15th, 2014, 08:28 PM
#9
Thread Starter
Addicted Member
Re: BitBlt issue smearing the image...
Originally Posted by Niya
It looks like his tile is smaller than the actual map so he actually has nothing to draw.
Took me a second to understand what you meant by that, but now I get it. Nothing in the previous comments was making sense.
If the character was moving Northwest, eventually the map would have to stop at 0, 0. Thanks for helping me.
-
Jan 22nd, 2014, 10:21 AM
#10
Thread Starter
Addicted Member
Re: [RESOLVED] BitBlt issue smearing the image...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|