Sign in to follow this  
Renegadeandy

Using the Picture Control C++ (resources)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this