471,348 Members | 1,524 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,348 software developers and data experts.

Using the Picture Control

Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.
Jul 21 '05 #1
5 2105
Hi Michael,

Both the controls are very strightforward. Since you had been programming
for some time, it shouldn't be a problem at all.

Here's an MSDN link which shows how to set the picture in the PictureBox
control at run time
http://msdn.microsoft.com/library/de...satruntime.asp
You could also directly set the path to the picture.

And here's the MSDN's intro to the OpenFileDialog component
http://msdn.microsoft.com/library/en...oloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan

"Michael" wrote:
Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.

Jul 21 '05 #2
Thanks for the quick reply, but im still confused. The sites you included are
helpful, but when trying the code for the PictureBox, it comes back with
multible errors, ones i have no idea how to fix, here they are:

error C2065: 'pictureBox1' : undeclared identifier

error C2227: left of '->Image' must point to class/struct/union
type is ''unknown-type''

error C2653: 'String' : is not a class or namespace name

error C2653: 'System' : is not a class or namespace name

error C2653: 'System' : is not a class or namespace name

error C2065: 'Personal' : undeclared identifier

error C3861: 'Concat': identifier not found, even with argument-dependent
lookup

error C3861: 'GetFolderPath': identifier not found, even with
argument-dependent lookup

Thanks, Michael

"Rakesh Rajan" wrote:
Hi Michael,

Both the controls are very strightforward. Since you had been programming
for some time, it shouldn't be a problem at all.

Here's an MSDN link which shows how to set the picture in the PictureBox
control at run time:
http://msdn.microsoft.com/library/de...satruntime.asp
You could also directly set the path to the picture.

And here's the MSDN's intro to the OpenFileDialog component.
http://msdn.microsoft.com/library/en...oloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan

"Michael" wrote:
Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.

Jul 21 '05 #3
Hi,

I guess you copy-pasted the samples given in the articles.

Instead of doing that, create a new project and drag and drop the required
components and code. Don't copy the sample code exactly as it is given -
instead copy only the portions you need and modify the control names as you
have given in your code.

HTH,
Rakesh Rajan
"Michael" wrote:
Thanks for the quick reply, but im still confused. The sites you included are
helpful, but when trying the code for the PictureBox, it comes back with
multible errors, ones i have no idea how to fix, here they are:

error C2065: 'pictureBox1' : undeclared identifier

error C2227: left of '->Image' must point to class/struct/union
type is ''unknown-type''

error C2653: 'String' : is not a class or namespace name

error C2653: 'System' : is not a class or namespace name

error C2653: 'System' : is not a class or namespace name

error C2065: 'Personal' : undeclared identifier

error C3861: 'Concat': identifier not found, even with argument-dependent
lookup

error C3861: 'GetFolderPath': identifier not found, even with
argument-dependent lookup

Thanks, Michael

"Rakesh Rajan" wrote:
Hi Michael,

Both the controls are very strightforward. Since you had been programming
for some time, it shouldn't be a problem at all.

Here's an MSDN link which shows how to set the picture in the PictureBox
control at run time:
http://msdn.microsoft.com/library/de...satruntime.asp
You could also directly set the path to the picture.

And here's the MSDN's intro to the OpenFileDialog component.
http://msdn.microsoft.com/library/en...oloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan

"Michael" wrote:
Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.

Jul 21 '05 #4
Ok, i understand that, but what i dont understand is the member variable
"pictureBox1". There is a "PictureBox1", the name of the picture control in
my project, but after changing the name, nothing different, i change the
..Image to just "image.gif", not all the stuff about the "My Documents"
folder, but it still comes up with errors. I change the code to just this:
PictureBox1->Image = Image::FromFile("Image.gif");
where it only comes up with 3 errors.
error C2065: 'PictureBox1' : undeclared identifier
error C2227: left of '->Image' must point to class/struct/union
type is ''unknown-type''
error C2064: term does not evaluate to a function taking 1 arguments

maybe if you could send me a sample project, or a detailed explanation, that
would be great, sorry for my lack of knowledge, ive worked with 6.0 for a
while, not .NET, just got it.

Thanks, Michael
Email: ca***********@gmail.com
"Rakesh Rajan" wrote:
Hi Michael,

Both the controls are very strightforward. Since you had been programming
for some time, it shouldn't be a problem at all.

Here's an MSDN link which shows how to set the picture in the PictureBox
control at run time:
http://msdn.microsoft.com/library/de...satruntime.asp
You could also directly set the path to the picture.

And here's the MSDN's intro to the OpenFileDialog component.
http://msdn.microsoft.com/library/en...oloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan

"Michael" wrote:
Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.

Jul 21 '05 #5
Never mind, even though you havent responded. I found a great site that
helped alot, and it has things in C++6.0 and .NET, both of which I use.

Check it out:

http://functionx.com/

"Michael" wrote:
Ok, i understand that, but what i dont understand is the member variable
"pictureBox1". There is a "PictureBox1", the name of the picture control in
my project, but after changing the name, nothing different, i change the
.Image to just "image.gif", not all the stuff about the "My Documents"
folder, but it still comes up with errors. I change the code to just this:
PictureBox1->Image = Image::FromFile("Image.gif");
where it only comes up with 3 errors.
error C2065: 'PictureBox1' : undeclared identifier
error C2227: left of '->Image' must point to class/struct/union
type is ''unknown-type''
error C2064: term does not evaluate to a function taking 1 arguments

maybe if you could send me a sample project, or a detailed explanation, that
would be great, sorry for my lack of knowledge, ive worked with 6.0 for a
while, not .NET, just got it.

Thanks, Michael
Email: ca***********@gmail.com
"Rakesh Rajan" wrote:
Hi Michael,

Both the controls are very strightforward. Since you had been programming
for some time, it shouldn't be a problem at all.

Here's an MSDN link which shows how to set the picture in the PictureBox
control at run time:
http://msdn.microsoft.com/library/de...satruntime.asp
You could also directly set the path to the picture.

And here's the MSDN's intro to the OpenFileDialog component.
http://msdn.microsoft.com/library/en...oloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan

"Michael" wrote:
Ive been programming for some time now, so i wanted to get into graphics, but
i wanted to see if I could make a Picture Viewer. I have no experience with
the picture control, ive tryed the MSDN tutorial for the control. If the code
to use it in is in Basic, dont bother sending it. Nor do i have much
experience with the "Open" dialog box.

Jul 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Z D | last post: by
5 posts views Thread by Michael | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.