![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | 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) |
| | 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 | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| System Image - Extract Files Using Virtual PC 2007 | Tutorials | |||
| Using Ildasm.exe to extract an image in a PictureBox | .NET General | |||
| the display goes crazy | Vista hardware & devices | |||
| funny image making my vista go crazy | Vista General | |||
| HP Compaq NX7000 display goes crazy after install | Vista hardware & devices | |||