• Advertisement

Archived

This topic is now archived and is closed to further replies.

HELP!!! Photoshop killing my bitmaps!

This topic is 6581 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

Ok, this is bizarre. I am an extreme newbie, and I am working my way through Lamothe''s latest Gurus book. I am up to example 7_10, which loads a bitmap to the screen (a picture of the starship Enterprise). After a couple of weeks of slogging through the book, I am very excited to be putting graphics of any sort on the screen. Imagine my frustration at being stuck now. I tried replacing the name of the bitmap (in 7_10.cpp) with one I had created, and compiled. Didn''t work. I tried a bunch of other things to narrow down the problem, until finally, I tried copying the precompiled executable and the bitmap from the CD to my local drive. I run it, it works fine. Then, I open the bitmap in Photoshop 4.0, save it under the SAME NAME without making ANY changes, and run the executable. It errors out. This is very frustrating. I made no changes to the code or the bitmap. I am assuming (from what little I know of how bitmap files are put together) that Photoshop encodes the bitmap in such a way that Lamothe''s code doesn''t work? But that would be absurd, b/c _everybody_ uses Photoshop. Any help would be greatly appreciated. It''s example 7_10 from Tricks of the Windows Game Programming Gurus. - Chris the distraught newbie

Share this post


Link to post
Share on other sites
Advertisement
I''ve never used Photoshop or Lamothe''s book, but having said that the first thing I would check is if Photoshop is saving the file as a bitmap (as opposed to another, proprietary, format) and that the bitmap is being saved with the same colour depth as before (e.g. if it was an 8-bit palletized bitmap and you saved it as a 24-bit bmp, the code may realize this and produce an error). Anyhow, hopefully someone who uses the Lamothe book will see your post and help you out. Good luck.

Share this post


Link to post
Share on other sites
Oh, yeah, let me be clear:

The file on the cd was bitmap8.bmp (all lowercase).

I opened it in Photoshop 4.0, and it imported its own palette. I then saved it, wihtout changing the name, as a .bmp file, in 8 bit Windows format, without checking the RLE compression box.

:-) Still doesn''t work tho. *sigh*

What do you folks use to create graphics?

-Chris

Share this post


Link to post
Share on other sites
If your on chapter 7, maybe you could help me with chapter 6 - how do you get the DDURFACEDESC2 variable to register with VC++ - it picks up DDSURFACEDESC, as long as I don;t put the 2 on the end. This is fustrating me now, and I have included all the necessary headers and libraries and put them in the VC++ lookup directories.
Other than that - I can''t help you with your Photoshop problem, because I don''t own it. I''d suggest another test with something like Windows paint - you never know what Photoshop might be doing optimising things...

Cheers,

-Mezz

Share this post


Link to post
Share on other sites
I use photoshop for my graphics, but I have heard that time to time photoshop fudges up the bmp format.

Try opening it with mspaint and resaving it, this fixes any problems that photoshop introduces.

If you still have the bug then it is something else
Maybe the example program can''t handle different width/height.

Atavist

Share this post


Link to post
Share on other sites
You can''t Photoshop files because Photoshop calculates bmp files sizes diffirent than t3dlib(i think that was the reason)
You could change the Load_Bitmap_File function or save the image in some other graphic program (like PSP) after you draw it in Photoshop

Share this post


Link to post
Share on other sites
Yea photoshop adds a few extra bits onto the end of your bitmap files for some odd reason. It causes all hell to be raised when you try loading the bitmaps in your apps. The best way to fix this is to just load the photoshop bmp files into MS Paint, and then save them again.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
to mezz did you add the line
#define INITGUID
to your project ?

Share this post


Link to post
Share on other sites
In Lamothe''s old Window Game Programming you couldn''t load in a bitmap saved in RLE form. I am guessing Photoshop saves in guess what... RLE form. Use Paint Shop Pro and save in RGB form.

Share this post


Link to post
Share on other sites

  • Advertisement