Jump to content
  • Advertisement


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


Graphics in windows (GDI)

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

I have a window that I want to draw a picture on (w/o DX). I read the image from a file with the following format: 2-bytes Height 2-bytes Width 4-bytes RGBQuad(Red,Green,Blue,Alpa) (Transparency Color) ...-bytes Image data (Height*Width*4) Is there a way to draw this image to a window without plotting each individual pixel? If so, how? I''m not so worried about Pixel Format because I understand how to check that. Thanks, Jumpster

Share this post

Link to post
Share on other sites
This is what i usualy do. i write my graphics/game programs
with GDI coz it is easier to implement and debug, finaly i do
convert the whole stuff using my directx libs.
There are two major ways to draw bitmaps in windows API.
One is easier to access the pixel data : DIB Images (Device Independent Bitmaps) which can be in several color depths,
and can be shown using the StretchDIBits api function, screen
color depth doesn''t matter coz StretchDIBits does the proper
conversion for you. Transparency is NOT supported by these kind
of images.
Another way is using the windows bitmap objects, but they need
more work to obtain direct access to the pixel data, Blt and
StretchBlt functions are used to copy them onto screen,
transparency is not handled easily until Windows 98 in which
you have the TransparentBlt function.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!