Jump to content
  • Advertisement
Sign in to follow this  
GetWindowRect

Add a picture to a control.

This topic is 4834 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 posted this in the "For Beginners" section, but I believe I might have posted it in the wrong section, I appologize for the double post. I would like to display pictures on some different types of controls to make applications look different and/or more appealing. I would like to figure out how to display background images onto, for example, buttons, scrollbars, textboxes etc... In order to load an image onto a normal window I use the WM_ERASEBKGND or WM_PAINT, however I do not know how to process those messages for indiviual controls, only the window. I am sure there is a way to do it, I just have no idea how to go about doing it. Another thing I would like to do, if it would not be too difficult, would be to display these images semi transparent so text could be more easily read on the image. If anyone has any idea how to point me in the right direction, or samples/examples of any kind, I would appreciate it greatly. Thanks you in advance.

Share this post


Link to post
Share on other sites
Advertisement
You can subclass controls, meaning you can handle a control's messages and do what you want to make it behave differently. See Safe Subclassing in Win32 on MSDN.

You can also use the "owner draw" specification, though only Windows XP and later support this. With owner draw you are responsible for drawing the control, all other behaviour is unchanged. See Using Windows XP Visual styles on MSDN.

Share this post


Link to post
Share on other sites
I have heard quite a bit about subclassing but never learned about it. It does sound like it can do what I am trying to do now, as well as add some powerful options I will think of in the future. Thank you very much for the link you posted I will begin checking that out and hopefully figure it out.

Thank you again outRider, your reply is much appreciated.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!