Advertisement

Loading jpg pics and putting them on a directdraw surface.

Started by October 06, 2002 04:19 PM
3 comments, last by endasil 22 years, 1 month ago
Right, windows has built in support for reading bmp files, but they take up a huge amount of space, so i need to find a way to load another picture format like for example jpg and put it on the direct draw surface. If anyone knows any good tutorial for this or can explain it fairly easily by responding to this post, i would be very thankful. oh, and check out my little game:www.dragonrealmsoftware.com Endasil I need more beta tester for my game! Check out http://www.dragonrealmsoftware.com
EndasilVisit my site, try my gameswww.dragonrealmsoftware.comI need more beta tester for my game! Check out http://www.dragonrealmsoftware.com
I get an error when trying to d/l your demo...
---------------------My specs (because I always forget to post them)Intel P4 2.4 GHz640 MB system memoryRadeon 9700 PROWindows XPDirectX 9DirectX 8.1 SDK
Advertisement
Thanks for pointing this out, i have updated the link to pointed at the right place now.

Endasil


I need more beta tester for my game! Check out http://www.dragonrealmsoftware.com
EndasilVisit my site, try my gameswww.dragonrealmsoftware.comI need more beta tester for my game! Check out http://www.dragonrealmsoftware.com
quote: Original post by endasil
Right, windows has built in support for reading bmp files, but they take up a huge amount of space, so i need to find a way to load another picture format like for example jpg and put it on the direct draw surface. If anyone knows any good tutorial for this or can explain it fairly easily by responding to this post, i would be very thankful.


oh, and check out my little game:www.dragonrealmsoftware.com


Endasil


I need more beta tester for my game! Check out http://www.dragonrealmsoftware.com


Non-Compressed image types are the easiest to read in. This includes TGA and BMP. Why? Because you don''t need to run a decompression algo''s on these image types while reading them in to convert them into readable RGB data. However because they are not compressed they are also large in file size. Jpeg and Gif are considered "lossy" compression types. This means any data saved in these formats are going to experiance a quality loss. Sometimes this loss is small other times it''s large. Due to the loss these images have sizes much smaller than that of a BMP or TGA. There is also another format called PNG around. This is a non-lossy image format. However most of the time it''s size is equivilent to a BMP or TGA using RLE.

Now the reason I stated the above was not because I think your dumb or that you don''t know the formats, I just wanted to get across the point that loading a jpeg from scratch is going to be alot more difficult than loading uncompressed image types. There is an image I think it''s called freeimage out there which will load in a jpeg for you. This is probably the best way to go, you''ll have to search the net for it though as I don''t have a link.

quote: Original post by endasil
Right, windows has built in support for reading bmp files, but they take up a huge amount of space, so i need to find a way to load another picture format like for example jpg and put it on the direct draw surface. If anyone knows any good tutorial for this or can explain it fairly easily by responding to this post, i would be very thankful.


oh, and check out my little game:www.dragonrealmsoftware.com


Endasil


I need more beta tester for my game! Check out http://www.dragonrealmsoftware.com


Non-Compressed image types are the easiest to read in. This includes TGA and BMP. Why? Because you don''t need to run a decompression algo''s on these image types while reading them in to convert them into readable RGB data. However because they are not compressed they are also large in file size. Jpeg and Gif are considered "lossy" compression types. This means any data saved in these formats are going to experiance a quality loss. Sometimes this loss is small other times it''s large. Due to the loss these images have sizes much smaller than that of a BMP or TGA. There is also another format called PNG around. This is a non-lossy image format. However most of the time it''s size is equivilent to a BMP or TGA using RLE.

Now the reason I stated the above was not because I think your dumb or that you don''t know the formats, I just wanted to get across the point that loading a jpeg from scratch is going to be alot more difficult than loading uncompressed image types. There is an image lib out there, I think it''s called freeimage which will load in a jpeg for you. This is probably the best way to go, you''ll have to search the net for it though as I don''t have a link.

This topic is closed to new replies.

Advertisement