![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #2 (permalink) |
| Guest | 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 |
| | #3 (permalink) |
| Guest | 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 > > > > |
| | #4 (permalink) |
| Guest | 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 > > > > |
| | #5 (permalink) |
| Guest | 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 |
| | #6 (permalink) |
| Guest | 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 |
| |
| |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Acronis True Image recovery of Vista Image | mrh981 | Vista General | 1 | 07-01-2008 09:57 PM |
| Image Restore Problem: Can't Locate Image | Paputxi | Vista General | 4 | 07-13-2007 05:52 PM |
| Not enough resources | Eric the Grey | Vista hardware & devices | 4 | 03-13-2007 10:13 PM |
| Button with regular image and disabled image | loumfranco@gmail.com | Avalon | 1 | 05-31-2006 02:47 PM |
| Using Resources | Erno | Avalon | 3 | 01-31-2006 06:59 AM |