![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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) |
| | 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) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| changes in color in image program | Virtual PC | |||
| HELP with color change!!!!!! | General Discussion | |||
| Can't change Color of pages using color/appearance | Vista installation & setup | |||
| change tab color | Vista General | |||
| Canon Color Image Runner 3200 | Vista hardware & devices | |||