![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | Image resources Hi, If I set the application icon in the project properties, How can I load it to the WPF window icon? Can I store the graphics in XAML? How can I set the graphics in databound control item, eg. in treeview/listbox etc? Thanks, Jan |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Image resources In article <6F4641EE-0206-4305-9B1D-07F04B80C366@microsoft.com>, uam@centrum.cz says... > Hi, > If I set the application icon in the project properties, How can I load it > to the WPF window icon? > > Can I store the graphics in XAML? > > How can I set the graphics in databound control item, eg. in > treeview/listbox etc? > > Thanks, > Jan > > When you browse for and set an icon file in the project properties in Visual Studio, you will see that file appear in the solution explorer as it has been added to the project (physically) and will be compiled as a resource. To get that icon to actually be used in the Window specify the Icon property for the Window Object in the XAML: <Window x:Class="myapp.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="iconplay" Height="300" Width="300" Icon="myicon.ico" > ..... store the graphics in XAML? ==> You can declare (vector) objects that are graphics in XAML. Have a look at the System.Windows.Shapes Namespace and its derived classes as in: <Line X1="200" Y1="150" X2="300" Y2="250" Stroke="Red" /> raster graphics are handled by the Image class: <Image> <Image.Source> <BitmapImage UriSource="myjpg.jpg" /> </Image.Source> </Image> ...... set the graphics in databound control item?==> You will need to use a DataTemplate. see "Data Templating Overview" in the SDK docs. HTH, Bob |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Image resources Hi Bob! Thank you for your answer, it is exactly what I was asking. For graphics in DataBound item I found that I would need write the converter. Just a little question - can I embed the resource in xaml like CDATA or something? Thanks, Jan "Bob" <bb_brt@yahoo.com> wrote in message news:MPG.1fc3fd7358572fc0989680@news.comcast.giganews.com... > In article <6F4641EE-0206-4305-9B1D-07F04B80C366@microsoft.com>, > uam@centrum.cz says... >> Hi, >> If I set the application icon in the project properties, How can I load >> it >> to the WPF window icon? >> >> Can I store the graphics in XAML? >> >> How can I set the graphics in databound control item, eg. in >> treeview/listbox etc? >> >> Thanks, >> Jan >> >> > When you browse for and set an icon file in the project properties in > Visual Studio, you will see that file appear in the solution explorer as > it has been added to the project (physically) and will be compiled as a > resource. To get that icon to actually be used in the Window specify the > Icon property for the Window Object in the XAML: > > <Window x:Class="myapp.Window1" > xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" > Title="iconplay" Height="300" Width="300" > Icon="myicon.ico" >> > .... > > store the graphics in XAML? ==> You can declare (vector) objects that > are graphics in XAML. Have a look at the System.Windows.Shapes Namespace > and its derived classes as in: > <Line X1="200" Y1="150" X2="300" Y2="250" Stroke="Red" /> > > raster graphics are handled by the Image class: > <Image> > <Image.Source> > <BitmapImage UriSource="myjpg.jpg" /> > </Image.Source> > </Image> > > ..... > > set the graphics in databound control item?==> You will need to use a > DataTemplate. see "Data Templating Overview" in the SDK docs. > > HTH, > Bob > > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Image resources In article <A4A1200F-99D2-4A8B-ADEF-11E92B221F14@microsoft.com>, uam@centrum.cz says... > Hi Bob! > Thank you for your answer, it is exactly what I was asking. > For graphics in DataBound item I found that I would need write the > converter. > > Just a little question - can I embed the resource in xaml like CDATA or > something? > > Thanks, > Jan > > > "Bob" <bb_brt@yahoo.com> wrote in message > news:MPG.1fc3fd7358572fc0989680@news.comcast.giganews.com... > > In article <6F4641EE-0206-4305-9B1D-07F04B80C366@microsoft.com>, > > uam@centrum.cz says... > >> Hi, > >> If I set the application icon in the project properties, How can I load > >> it > >> to the WPF window icon? > >> > >> Can I store the graphics in XAML? > >> > >> How can I set the graphics in databound control item, eg. in > >> treeview/listbox etc? > >> > >> Thanks, > >> Jan > >> > >> > > When you browse for and set an icon file in the project properties in > > Visual Studio, you will see that file appear in the solution explorer as > Jan asked... > Just a little question - can I embed the resource in xaml like CDATA or > something? The question begs: "Why bother?" are you looking to use only loose XAML? All the intelligent minds at MS came up with XAML and codebehind, marrying them together (via the partial keyword) into a single class, as a means to cleanly seperate the visual design from the nuts and bolts on the backend. If you are still interested, google up "XAML + CDATA" and see how to place code in the markup and the XAML compiler will take care of it. HTH, Bob |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Various Errors - winlogon.exe Bad Image, Windows - Bad Image & Window Defender | General Discussion | |||
| Acronis True Image recovery of Vista Image | Vista General | |||
| Image Restore Problem: Can't Locate Image | Vista General | |||
| Not enough resources | Vista hardware & devices | |||