Jump to content

View more

Image of the Day

The night is still, but the invasion brings chaos. #screenshotsaturday #hanako #indiegame #gameart #ue4 #samurai https://t.co/cgILXuokoS
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

Sign up now

16 bit images in directx

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 05 November 1999 - 08:26 AM

Hello, having just started in DirectX I have got some functions to load bitmaps. The only problem is that I am using 800 x 600 x 16bit and the images are 24 bit.

None of the programs i have (neither Photoshop or paint shop pro) allow images to be 16 bit.

Of course, I could go up to 24 bit in the game - but my video card doesn't have enough onboard memory , or go down to 640x480 - which isn't a desirable option...

Anyone know of an art package that lets you use 16 bit? Or a way or creating a surface (i think) that isn't on the video card memory? (i have 64 meg ram but only 2 meg graphics card...)

I know this message probably should have gone in the Art section, but it seems that not many people frequent that board.

Thanks all,

Shifty Bastard

#2 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 04 October 1999 - 01:46 AM

In 16 bit,it have 565 and 555 mode.So maybe no one use 16 bit images.You can convert
8/24/32 bit images to 16 bit surface in DX.
Check the DDUTIL.CPP in your DirectX SDK.
The DDLoadBMP function can do this.

#3 Sphet   Members   


Posted 04 October 1999 - 06:51 AM

Dark Worl is right.

You will have a very hard time finding a program that saves images in 16 bit mode. The sollution most of us take, I suspect, is saving images in 24 bit colour and dropping the least significant bits when loading. I hate the way this looks on some images because it introduces banding in gradiants. I just make a special effort to do my art very very carefully.

#4 Qoy   Members   


Posted 04 October 1999 - 07:10 PM

Hello. You can create surfaces on system memory rather than video memory. I think this is how you would do it:
When you are setting up your DDSURFACEDESC structure, and you are putting in the ddsCaps flags, you can plug in the DDSCAPS_SYSTEMMEMORY flag.
Look up DDSCAPS and DDSURFACEDESC in the DirectX SDK documentation for more information.
Hope this helps,

#5 Facehat   Members   


Posted 05 October 1999 - 08:47 AM

Another Suggestion:
You could use Targas. You can save those in 16bit color mode and they're simple to load. Plus, just about every art package (excluding Windows Paint :p) supports them.


#6 mhkrause   Members   


Posted 18 October 1999 - 07:42 AM

I usually store my images on disk as 24 or 32-bit, then convert them to whatever my texture format is at load time.

If I need to save space, I use DXTn compression (4-bits per pixel) if it doesn't degrade the image too much (usually not) and decompress at load-time, if necessary.

#7 TANSTAAFL   Moderators   

Posted 18 October 1999 - 09:52 AM

to load a bitmap (of any format) onto a surface (of any pixel format):

1-Create a compatible system DC with CreateCompatibleDC
2-Load the bitmap with LoadImage
3-Select the bitmap into the system dc
4-Create the surface with the proper dimensions
5-Get the DC of the surface with GetDC
6-BitBlt from the system dc onto the surfaces dc
7-release the surface dc, reselect into the system dc the old image, destroy the bitmap, and destroy the system dc


//the code
HDC sysdc=CreateCompatibleDC(NULL);
HBITMAP hbmnew=LoadImage(NULL,"Bitmap1.bmp",IMAGE_BITMAP,0,0,LR_LOADFROMFILE);
HBITMAP hbmold=(HBITMAP)SelectObject(sysdc,hbmnew);
HDC surfdc;

#8 Anonymous Poster_Anonymous Poster_*   Guests   

Posted 05 November 1999 - 08:26 AM

I've got a related question - I have written an image loader to load 8-bit PCX files into 16 bit DirectDraw surfaces for use under Direct3D as textures. My decompression uses 565 format, but I don't know whether this will be supported by all cards. If I support 555 and 565, would that ensure compatibility for most of the major accererators?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.