Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

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.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Image resources

Closed Thread
 
Thread Tools Display Modes
Old 11-07-2006   #1 (permalink)
Jan Kucera
Guest


 

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

Old 11-14-2006   #2 (permalink)
Bob
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




Old 11-15-2006   #3 (permalink)
Jan Kucera
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
>
>
>
>


Old 11-15-2006   #4 (permalink)
Jan Kucera
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
>
>
>
>


Old 11-15-2006   #5 (permalink)
Bob
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
Old 11-15-2006   #6 (permalink)
Bob
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
Closed Thread

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








Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50