Sign in to follow this  

Image distortion

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In direct draw 7, I was placing an animation loop on a series of surfaces. I got the code from 'Tricks of the windows game programming gurus, second edition'. The code worked fined for loading the images provided in the book. I grab a couple of sprites from the net, edited them in photoshop and, although the placement in the surface was somewhat buggy, it worked fine. I went back to photoshop and edited the image to make the total width a little bigger and now the image is all distorted. I don't understand what happens. The animation looks similar to TVs when they get bad reception and one of the corners shifts slightly towards the oposite corner. What could be causing this problem?

Share this post


Link to post
Share on other sites
It's hard to say without seeing any code or the images in question, but my guess is that your image loading code doesn't properly deal with formats that do row padding. If that's the case, changing the images to have a width thats a multiple of 4 and see if that helps.

Share this post


Link to post
Share on other sites
Jeez, I messed it up again.

Now, the image width is a multiple of 4, each cell is multiple of 4, both vertically and horizontally and it doesn't work. It was working a momemt ago. I don't even know what I did to mess it up. Again, the images from the book work, so it might be some property of this image.

Any other thoughts? Does this happen to 16/24/32 bit images as well?

Edit:
Oh yeah, a little more info.

The images display, but it looks like the back half are on the front and the front are on the back half.

Share this post


Link to post
Share on other sites
This is crazy. I increased the bitmap's color table to 256 and now the bitmap works correctly. Jeez, I hope working with 16,24 or 32 bit bitmaps eliminate this problem.

Share this post


Link to post
Share on other sites
You grabed from more than one place? I would think the palettes are different. I would suggest that you open one and use that as a master (ie save a backup 1st). Copy you others into that saving individually. That should create them all with same palette.

Share this post


Link to post
Share on other sites

This topic is 4734 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this