Using the Picture Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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/d...bcon/html/vbconresettingpicturesatruntime.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-us/vbcon/html/vbconopenfiledialogcontroloverview.asp

Let me know if you need more help.

HTH,
Rakesh Rajan
 
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
 
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
 
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: (e-mail address removed)
 
Back
Top