Windows Phone @ MoDaCo: Using image file from properties in Visual Studio - Windows Phone @ MoDaCo

Jump to content

Galaxy Nexus Review
We put the Galaxy Nexus and Ice Cream Sandwich through their paces.

Google Music Launch
Google bring Music out of beta and launch their music store.

MoDaCo Plus / Ad Free
Hate ads? Want cool stuff? Sign up for a MoDaCo Plus / MoDaCo Ad Free account with Online Kitchen access!

Close
Open
Close
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Using image file from properties in Visual Studio
-----


#1 User is offline   Dantenas 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 1
  • Joined: 14-December 08
  • Devices:X-Peria

Posted 20 April 2009 - 09:27 AM

Hello,

In Visual Studio under Properties I have inserted image.jpg
I want to use it in the background. I start by backgroundImage = new Bitmap(@"...");
What should I write instead of ...?
When I drag the image.jpg entry it gives me this path: C:\Documents and Settings\Martin\Desktop\Xperia\MMCalc\Properties\image.jpg
Unfortunately when I use it I get error that path is wrong.
I know that I can just use pictureBox, but this way has less flicker.

Can you help me to understand how this path works?

Thank you

0

Sponsored Links


#2 User is offline   DaveShaw 

  • Newbie
  • Pip
  • Group: Members
  • Posts: 19
  • Joined: 21-November 08
  • Location:Huddersfield
  • Devices:HTC Kaiser

Posted 24 April 2009 - 12:46 PM

View PostDantenas, on Apr 20 2009, 10:27, said:

Hello,

In Visual Studio under Properties I have inserted image.jpg
I want to use it in the background. I start by backgroundImage = new Bitmap(@"...");
What should I write instead of ...?
When I drag the image.jpg entry it gives me this path: C:\Documents and Settings\Martin\Desktop\Xperia\MMCalc\Properties\image.jpg
Unfortunately when I use it I get error that path is wrong.
I know that I can just use pictureBox, but this way has less flicker.

Can you help me to understand how this path works?

Thank you


Add the Image as an "Image Resource" using the Project properties Dialog.

Then use code like:
  Image backgroundImage = Properties.Resources.MyBackgroundResourceImage; //MyBackgroundResourceImage is the name of the Resource.

Dave

0


Sponsored Links

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2012. MoDaCo uses IntelliTxt technology. Privacy Policy / Contact Details.

Skin and Language

Sign in here


Sign in options
Log in with Facebook Log in with Twitter   Go to advanced login Register Now!