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

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

Update your Vista Drivers Update Your Drivers Now!!
Closed Thread
 
Thread Tools Display Modes
Old 06-26-2006   #1 (permalink)
Thomas Mueller
Guest


 

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
Guest


 

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
Closed Thread

Thread Tools
Display Modes



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to include XAML files into another XAML file? star-italia .NET General 6 06-12-2008 04:56 AM
Vector graphic image Oriane Avalon 4 11-30-2007 10:59 AM
Grayscale Printing with HP 6110 Kirin Vista General 3 05-27-2007 08:20 PM
Windows Desktop Grayscale!? Matt B. Vista installation & setup 1 01-31-2007 03:58 PM
How to deploy an XAML-based App with its XAML-UI-File? Solveigh Avalon 11 11-08-2006 07:50 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 51