Image distortion

Started by
5 comments, last by kubicon 19 years, 3 months ago
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?
Advertisement
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.
wow, it worked. There was no way I was gonna guess that.


Thanks
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.
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.
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.
Screw it. I'm just gonna work with 16bit images from now. But thanks

This topic is closed to new replies.

Advertisement