![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
| |
| | #1 (permalink) |
| | button images from resources Hi all! I am using VS2005 and I am struggling with a simple problem for which I couldn't find a simple solution. Maybe because my background is hardcore Java .So, I included an image in my resources and I want to use it form XAML. The code I saw so far says to put something like: <Image Source="..\Resources\image.gif" ... which is in my opinion ... strange because I saw that each image added to the resources generates code like this: quote form Resources.resx xaml ..... <data name="image" type="System.Resources.ResXFileRef, System.Windows.Forms"> <value>..\Resources\image.gif;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> ...... and qoute from Resource.Designer.cs ..... internal static System.Drawing.Bitmap image{ get { object obj = ResourceManager.GetObject("image", resourceCulture); return ((System.Drawing.Bitmap)(obj)); } } ..... So, I "feel" that VS generates some items for me to use but I couldn't figure out how to do it from XAML. I agree that VS created the Resources directory into my project although the initial image was in a different directory - and this might help - but still, I find this ... strange. The only way I found to use the "image" was programmatically in c# using ResourceManager and a Bitmap to BitmapImage converter which somehow duplicates the code generated automatically by VS. I repeat, I'd like to use the image from resources in XAML only. Is <Image Source="..\Resource\image.gif" ... the only way? Thank you, Catalin |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Button Cotrol: Event, when mouse leaves button with mousebutten still down | .NET General | |||
| Vista SP2: Stop button disabled when Send/Recv button pressed | Vista mail | |||
| Re: Attachment Save Button Greyed out for images | Vista mail | |||
| Button images missing in Windows Help system | Vista General | |||
| disable lock button beside power button? | Vista General | |||