![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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 | Crazy question - is there any way to extract the display of a windowinto an image file? Just like the subject says. I've got this idea for extracting an image (.bmp, .jpg, .pnf, whatever) that looks like the display of a window and putting it at the content of a WPF button. Does anyone know of a possible way to do that? I was hoping I could actually nest the window directly as the button content, but that ends up with the following runtime exception: {"Window must be the root of the tree. Cannot add window as a Logical or Visual child of any Visual."} Thanks! Jason |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Re: Crazy question - is there any way to extract the display of a window into an image file? I think you are looking for VisualBrush. Unfortunately, if you try to reference a visual earlier in the tree you end up in an infinite loop. It doesn't look like you will be able to use this to get an image of the entire window. Depending on your exact scenario this simple example may help: <Window x:Class="WindowsApplication.Window1" xmlns="http://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"> <DockPanel> <StackPanel Name="MainWindow"> <Button>Button 1</Button> <Button>Button 2</Button> <Button>Button 3</Button> </StackPanel> <Button> <Rectangle Width="300" Height="300"> <Rectangle.Fill> <VisualBrush Visual="{Binding ElementName=MainWindow}" /> </Rectangle.Fill> </Rectangle> </Button> </DockPanel> </Window> > Just like the subject says. I've got this idea for extracting an > image (.bmp, .jpg, .pnf, whatever) that looks like the display of a > window and putting it at the content of a WPF button. Does anyone > know of a possible way to do that? I was hoping I could actually nest > the window directly as the button content, but that ends up with the > following runtime exception: > > {"Window must be the root of the tree. Cannot add window as a Logical > or Visual child of any Visual."} > > Thanks! > Jason |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Using Ildasm.exe to extract an image in a PictureBox | Mezz | .NET General | 0 | 03-21-2008 12:49 PM |
| the display goes crazy | DJ_danne | Vista hardware & devices | 4 | 06-08-2007 06:14 PM |
| Extract a zip file | Christian | Vista security | 2 | 05-28-2007 05:21 PM |
| funny image making my vista go crazy | Maciej Sołtysiak | Vista General | 3 | 05-22-2007 09:30 AM |
| HP Compaq NX7000 display goes crazy after install | =?Utf-8?B?UmljaA==?= | Vista hardware & devices | 0 | 09-06-2006 08:40 PM |