|
-
Jun 6th, 2010, 12:13 PM
#1
Thread Starter
Lively Member
[RESOLVED] Image and My.Settings - Please help
Hi all
Can anyone help me to solve this problem.
In my application I have two forms, the main application form and a second form, containing a number of images, allowing me to choose a background image tile for the main form.
I would like to store the full image path in a my.settings string so that when the application is run again the chosen background image is loaded automatically.
My problem is that the images on the second form are from my.resources. If I try code such as:
Code:
My.Settings.selectedbackground = My.Resources.BlueSilk9
I get the following error:
Code:
Value of type 'System.Drawing.Bitmap' cannot be converted to 'String'.
How can I get the full path of an image stored in my.resources which I could then place into my setting?
Thanks in advance.
-
Jun 6th, 2010, 07:01 PM
#2
Re: Image and My.Settings - Please help
You can't. You talk about paths, which implies files, but resources aren't files. They are binary data embedded in your EXE. If you have your images embedded as resources then I'd suggest storing a number in My.Settings. You can then use a Select Case statement to determine which resource to retrieve based on that number.
-
Jun 7th, 2010, 12:20 AM
#3
Thread Starter
Lively Member
Re: Image and My.Settings - Please help
Thanks jmc for replying.
That is exactly the route I ended up taking. However, it was so late when I got finished working on it last night that I didn't have time, and was too tired, to report back on forum.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|