Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 20th, 2006, 3:11 PM   #1
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
Exclamation need picture help

ok say i have a picture box and want users to be able to upload there own picture into itt what do i do?
RAzR Creations is offline   Reply With Quote
Old May 20th, 2006, 3:26 PM   #2
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
Try this:
Quote:
OpenDialog.ShowOpen
Form1.Caption = OpenDialog.FileName
Picture1.Picture = LoadPicture(OpenDialog.FileName)
you have to use the open dialog or if you want you can create your own one. then you just set the picture property(picture1.picture) to that they have selected from the open dialog and then pass that to loadpicture function, you can improve this by filter out other files such as text files and other non image files from the user in the open dialog box.
kruptof is offline   Reply With Quote
Old May 20th, 2006, 5:14 PM   #3
RAzR Creations
Programmer
 
RAzR Creations's Avatar
 
Join Date: Apr 2006
Location: orange park Fl
Posts: 53
Rep Power: 3 RAzR Creations is on a distinguished road
i dont fully understand
RAzR Creations is offline   Reply With Quote
Old May 21st, 2006, 3:43 AM   #4
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 330
Rep Power: 3 kruptof is on a distinguished road
Can you be more specific what don't you understand, any ways here is a little guide to help you:

okay on the menu bar goto project click it, then click the sub menu "Components", then the components dialog box would come up, now scroll down and select Microsoft Common Dialog Control x(x= what version number you are using) check the check box next to its name and then click apply.Click Close to get back to form. Now you should see a new control on the ToolBox called "CommonDialog", put it onto the form, using the properties window change its name to "OpenDialog", now put the picture box onto the form, and also put a command button onto the form. Double click the command button(to get to its command_click event), and put this code into the Command_Click Event:

Quote:
OpenDialog.Filter = "Bitmaps (.bmp)|*.bmp"
OpenDialog.ShowOpen
Form1.Caption = OpenDialog.FileName
Picture1.Picture = LoadPicture(OpenDialog.FileName)
kruptof is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:21 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC