![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 |
| | #1 (permalink) |
| Guest | How can i change a color value in a image object Hi @all, i have in my project a lot of image objects. i becam the image object from a resource dictionary. I get the image object of a resource Dictionary. My goal is it, that i change all blue regions in the image object to yellow or green. How can i do this with an image object from namespace System.Windows.Controls? Thanks for all answers TOM_MUE www.tom-mue.de |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: How can i change a color value in a image object You can use image effects to do it, but you may have to create your own. There may be an SDK sample on this now for June CTP...not sure. If you do have to use a custom image effect, it's a C++ thing...just FYI. It's also a software thing too. So, you'll want to be careful with perf during animations of image effects. I think for V2, ImageEffects will be in hardware. "Thomas Mueller" wrote: > Hi @all, > > i have in my project a lot of image objects. i becam the image object from a > resource dictionary. I get the image object of a resource Dictionary. My goal > is it, that i change all blue regions in the image object to yellow or green. > How can i do this with an image object from namespace System.Windows.Controls? > > Thanks for all answers > > TOM_MUE > www.tom-mue.de |
My System Specs![]() |
| | #3 (permalink) |
| Guest | RE: How can i change a color value in a image object I see in .Net Reflector that a WriteableBitmap class exists. Might be worth a look. Otherwise it looks like using a combination of CopyPixels and Create on a BitmapSource should allow you to examine the pixel values and replace whatever colors you desire. "Thomas Mueller" wrote: > Hi @all, > > i have in my project a lot of image objects. i becam the image object from a > resource dictionary. I get the image object of a resource Dictionary. My goal > is it, that i change all blue regions in the image object to yellow or green. > How can i do this with an image object from namespace System.Windows.Controls? > > Thanks for all answers > > TOM_MUE > www.tom-mue.de |
My System Specs![]() |
| | #4 (permalink) |
| Guest | RE: How can i change a color value in a image object hello Brandon and TheRHouge, Sorry for my late recall and Thanks for all answers. But the answers help me not. I think, i have not correctly described my situation. ok here is a new attempt: I have a simple XAML- Window Application. The project has also a resource dictionary file with the name "MyIcons". This resource dictionary is linked in my window1.xaml with the folowing code: <Window.Resources> <ResourceDictionary Source="MyIcons.xaml"/> </Window.Resources> in the resource dictionary i have a image draw object that i have exportet from the expression graphic designer. It is a simple rectangle and the rectangle contains a circle. the xaml from the image is here <DrawingImage x:Key="RectImage"> <DrawingImage.Drawing> <DrawingGroup> <DrawingGroup.Children> <GeometryDrawing Geometry="F1 M 215.333,207.333L 551.333,207.333L 551.333,400.667L 215.333,400.667L 215.333,207.333 Z "> <GeometryDrawing.Pen> <Pen Thickness="1.63255" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" Brush="#FF000000"/> </GeometryDrawing.Pen> <GeometryDrawing.Brush> <!-- Unnamed_gradient_137 --> <LinearGradientBrush StartPoint="4.51935e-008,0.5" EndPoint="1,0.5"> <LinearGradientBrush.GradientStops> <GradientStop Color="#FFFFFFFF" Offset="0.005618"/> <GradientStop Color="#FF8A8A8A" Offset="1"/> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </GeometryDrawing.Brush> </GeometryDrawing> <GeometryDrawing Brush="Red" Geometry="F1 M 380,242C 414.978,242 443.333,270.654 443.333,306C 443.333,341.346 414.978,370 380,370C 345.022,370 316.667,341.346 316.667,306C 316.667,270.654 345.022,242 380,242 Z "> <GeometryDrawing.Pen> <Pen Thickness="1.63255" StartLineCap="Round" EndLineCap="Round" LineJoin="Round" Brush="#FF000000"/> </GeometryDrawing.Pen> </GeometryDrawing> </DrawingGroup.Children> </DrawingGroup> </DrawingImage.Drawing> </DrawingImage> Now i define a image object in the xaml from window1 and set the source of the key to my drawing image in the resource dictionary. the key is "RectImage". here is the code: <Image Source="{DynamicResource RectImage}" /> this works fine. my goal is it now, that i can change the brush from the last geometry object (the circle object) in the drawing image object. when you look in the code from the drawing image, you will see the brush is in the default Red. I will change the brush to green from the code behind or per tricker an setter in the XAML. How can i do this? Thanks for all answers TOM_MUE www.tom-mue.de "Brandon Furtwangler" wrote: > I see in .Net Reflector that a WriteableBitmap class exists. Might be worth > a look. > > Otherwise it looks like using a combination of CopyPixels and Create on a > BitmapSource should allow you to examine the pixel values and replace > whatever colors you desire. > > "Thomas Mueller" wrote: > > > Hi @all, > > > > i have in my project a lot of image objects. i becam the image object from a > > resource dictionary. I get the image object of a resource Dictionary. My goal > > is it, that i change all blue regions in the image object to yellow or green. > > How can i do this with an image object from namespace System.Windows.Controls? > > > > Thanks for all answers > > > > TOM_MUE > > www.tom-mue.de |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't change Color of pages using color/appearance | Nate | Vista installation & setup | 1 | 12-24-2007 12:27 AM |
| Toolbar Color Change? | OCJedi | Vista General | 10 | 08-07-2007 12:12 PM |
| change tab color | KittyJHG | Vista General | 1 | 03-19-2007 08:25 PM |
| change taskbar color | Vista General | 10 | 02-02-2007 12:37 PM | |
| Canon Color Image Runner 3200 | =?Utf-8?B?SlBAQU1Q?= | Vista hardware & devices | 0 | 09-25-2006 07:45 PM |