Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
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.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - How can i set the GrayScale for an XAML- Vector Graphic

 
 
Old 06-26-2006   #1 (permalink)
Thomas Mueller


 
 

How can i set the GrayScale for an XAML- Vector Graphic

Hi @all,

i develop a WPF Application with many controls, the have images as content.
The images i have exportet from Expression Graphic Designer as XAML in a
resource dictionary. This resource dictionary i have bind as new resource in
my window. For example:
<Window.Resources>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Icons.xaml"/>
</ResourceDictionary.MergedDictionaries>
</Window.Resources>

OK. For my button i use one of the many ControlTemplates with x:Key. this is
in the Icons.xaml file contained. For example:

<Button>
<StackPanel>
<ContentControl Template ="{StaticResource MyOpenImage}"
Width="20" Height="20"/>
</StackPanel>
</Button>

My goal is it to format the colored resource vector image to an grayscale.
so i think it look disabled.

How can i do this?

Thank you all for help

best greedings and a nice day
TOM
www.tom-mue.de



My System SpecsSystem Spec
Old 06-26-2006   #2 (permalink)
Thomas Mueller


 
 

RE: How can i set the GrayScale for an XAML- Vector Graphic

Hi people,


i think i found a solution. ok, at hard work i have change the type from my
vector- graphic in the resource dictionary file.

For example:

OLD Version ResourceDictionary:

<ControlTemplate x:Key="MyOpenImage">
<Viewbox Stretch="Uniform" >
<Canvas Width="10.719238" Height="10.718750">
<Canvas>
......
</ControlTemplate>

I can use that only with a content control. That is not which I needs.

NEW Version ResourceDictionary:

<DrawingImage x:Key="MyOpenImage">
<DrawingImage.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
....
</DrawingImage>

Now i can use this with an image control. For example:
.....
<Window.Resources>
<!-- that is the external resource dictionary file -->
<ResourceDictionary Source ="CircleII.xaml" />
</Window.Resources>
<Grid>
<Button>
<Image Width="200" Source="{StaticResource Circle}">
</Image>
</Button>
</Grid>
......

That is which i need. cool. now i have the problem with the GrayScale for a
Image. How can i set or use the GrayScale for my Image without
"FormatConvertedBitmap"? Is it possible? I think i have no chance to set the
Source property from "FormatConvertedBitmap" to my Circle resource. Or is it
possible to set the Source property to my Circle resource?

My goal is it, that the Image is disabled.

Thank you for all help

TOM
www.tom-mue.de

> Hi @all,
>
> i develop a WPF Application with many controls, the have images as content.
> The images i have exportet from Expression Graphic Designer as XAML in a
> resource dictionary. This resource dictionary i have bind as new resource in
> my window. For example:
> <Window.Resources>
> <ResourceDictionary.MergedDictionaries>
> <ResourceDictionary Source="Icons.xaml"/>
> </ResourceDictionary.MergedDictionaries>
> </Window.Resources>
>
> OK. For my button i use one of the many ControlTemplates with x:Key. this is
> in the Icons.xaml file contained. For example:
>
> <Button>
> <StackPanel>
> <ContentControl Template ="{StaticResource MyOpenImage}"
> Width="20" Height="20"/>
> </StackPanel>
> </Button>
>
> My goal is it to format the colored resource vector image to an grayscale.
> so i think it look disabled.
>
> How can i do this?
>
> Thank you all for help
>
> best greedings and a nice day
> TOM
> www.tom-mue.de
>
>

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Is it possible to include XAML files into another XAML file? .NET General
Grayscale Printing with HP 6110 Vista General
Windows Desktop Grayscale!? Vista installation & setup


Vista Forums 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 Ltd

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