• Advertisement

Archived

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

how to retrieve color of a pixel from an image?

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

hi folks. i would like to be able to load an image (GIF or JPG) into memory, then iterate through all the pixels in the image and create a 2D array of the hex values for each pixel. can someone enlighten me on the best way to do this? i''m using VC++ 6. i''d prefer to simply use the GDI rather than an external API like DirectX. thanks!

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by timmiepoo

i''m using VC++ 6. i''d prefer to simply use the GDI rather than an external API like DirectX. thanks!


Why not use an external API? If you are going to parse through a GIF or JPEG yourself, you''re gonna have to learn how to decompress the image which I think is pretty big task. Much easier if you just create it as a texture in DX.
Or, you could save it as BMP and fread() past the header and then start reading the pixels. That''s pretty easy.

Share this post


Link to post
Share on other sites

  • Advertisement