Jump to content
  • Advertisement
Sign in to follow this  
Renegadeandy

Using the Picture Control C++ (resources)

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

Ok, so I have a gui created using the Dialog which is my form and dragging items onto the form from the toolbox. So i also have a gui handler which is in a cpp file dealing with events! So i have dragged onto my form a picture Control. But i really have no idea how to use it, how to reference to it, or what the code would be to load a picture into it. I simply want this to be a picture - a logo of my company but this is proving very difficult for me to do! Im sure its very easy - does anybody have the time and kind nature to tell me what im doing wrong! Below is an image of what i have - to allow you to see if i am doing this wrong! http://img514.imageshack.us/img514/5862/codedo5.jpg Thanks Andy

Share this post


Link to post
Share on other sites
Advertisement
Go to "Resource View" window, click on the .rc file, "Add Resource".

In the "Add Resource" dialog, select Bitmap from the list and click "Import..".

Find the Bitmap image you want to use (from your company) and click OK.

Make a note of the "ID" of your Bitmap (properties);

Reselect the Picture control, and in the properties page, insert the bitmap id where it says "Image".

Share this post


Link to post
Share on other sites
Hi Verg!

Looks like we are getting somewhere! But after doing that and then compilnig and running - nothing appears at all, no little box- no picture! Imports fine though and im definately getting the ID correct of the image. The picture Control is set to bitmap - and visible is true. "IDR_JPEG1" is what i put in id!
http://img520.imageshack.us/my.php?image=code2hx4.jpg

Share this post


Link to post
Share on other sites
Is your company logo a .jpg? If so, you may have to change that to a .bmp file. Image conversion can be done by a number of free drawing tools.

Also try removing the quotes from "IDR_JPEG1".

Share this post


Link to post
Share on other sites
Yeah its a jpg - if you dont put " around the file it says invalid characters etc etc etc.

I suppose it probably should be a bmp - since it does seem to explictly say bitmap. I shall try that when i get back in about 2 hours!

Thanks

Andy

Share this post


Link to post
Share on other sites
You hit the nail on the head! Thanks ever so much you have told me exactly what i needed to know - now i understand!!!!!

Thanks!

Andy

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!