visualbrush

WPF VisualBrush with mixed aspect ratio

Hi@all I have some weird requirements for a visualbrush: This Visualbrush must be used in a third-party component for diagramming. We have lanes on the diagramming canvas, which stretch horizantally. We must define a background color for this lane, and some text on the top-left corner, which must be repeated on the x-axis. Now comes the ...

Is It Possible To Create A Cursor In WPF From a VisualBrush?

I'm doing some Drag and Drop operations, and I want to use a visual copy of the element I'm dragging for the cursor. It's easy enough to get a VisualBrush of the element, but I have no idea how to turn this into a cursor. I've read the Jamie Rodriguez blog posts, but his solution isn't quite what I'm looking for because he essentially ...

WPF 3D - Why does my ImageBrush not render??

I have a 3D plane which I'm trying to render with an ImageBrush as it's DiffuseMaterial.Brush. If i use a SolidColorBrush then the plane appears fine but I get nothing at all with either an ImageBrush or a VisualBrush. Can anyone tell me why? Here's the code. <ModelVisual3D> <ModelVisual3D.Transform> <RotateTransf...

How can you draw separate parts a control in different places with WPF?

Hello. I'm trying to split the drawing of a WPF UserControl onto two separate pages of a custom Paged Panel that I'm writing. I thought of using a VisualBrush to draw bits of the control. Is this the way to go? I presume I'll also have to put the controls that need to be visually split in an invisible container. Has anyone come across a...

Preview of a window (Visualbrush) that is not visible

Hi. I've created a window dinamically that's is in memory but is not visible yet. In other window I want to show a little preview of this window. I'm triying using a visualbrush to achieve this, setting the visual property of the visualbrush. It works perfectly with a visible window, but if the window is not visible, the visualbrush do...

VisualBrush of a Window in another Window

So basically, the MainWindow opens a second Window, let's say OptionsWindow. So in the OptionsWindow I want to show a visual of the MainWindow. I tried this, but didn't work: <Rectangle Grid.Row="1" Margin="3" Height="100"> <Rectangle.Fill> <VisualBrush Visual="{Binding Application.Current.MainWindow}" /> </Rectangle.Fill> </Rectang...

Align top-left corner of VisualBrush's Visual into top left corner of rendered area

I am using a VisualBrush as part of a control template. I want the image to not be tiled or scaled, and the top-left corner of the target visual to be aligned to the top-left corner of the rectangle I am filling. The trouble is, without specifying absolute Viewbox units, I can't make this happen, and I can't use absolute viewbox units in...

WPF : Help! Visual Brush streches all content

In my project I want to display a small logo on the side of a custom control. Since I have no canvas I thought maybe a Visual Brush would be a good Idea to place the logo in the background. <VisualBrush> <VisualBrush.Visual> <Rectangle Width="200" Height="200" Fill="Red" /> </VisualBrush.Visual> </VisualB...

C#, WPF - VisualBrush and OpacityMask

I'm needing to create a UserControl, that has a portion of the control's background transparent. The transparent portion is cutout in the shape of a Border with CornerRadius of 2--it's required because of the design. Here is my code that is not working: <UserControl Margin="1" x:Name="Box"> <UserControl.Resources> ...

How do I make a reflection effect in WPF ? (from code)

hi guys, I need to have some mirror objects in WPF. I have a Canvas with some content, and I need 50 visual clones, and if I modify something on the source, it should be updated in these clones. I know it is easy to do in XAML by binding the Visual of a VisualBrush to the element, but can's seem to do this from code. Can anyone help ...

Double Border with a VisualBrush in WPF

I'm curious if anyone knows of a way to easily get a double border effect in WPF similar to what you see in the selected items in Windows Explorer in Windows 7. If you look closely, you'll notice that the selected item has a dark border, a lighter, inner-border, and then a gradient background. Currently, I'm using two borders around ...

Scale a Visual Brush Background WPF

Hello, I have a Item called MiniMap in my xaml. I have set the background of it to a visual brush representting a canvas Item. Now, I want to scale the background to a ratio 0.7 . How can I do it? Thanks in advance <local:MiniMap Width="201" Height="134" x:Name="MiniMapItem" MinHeight="100" MinWidth="100" Opacity="1" SnapsToDevicePixels...

WPF Binding a visual brush's visual to a different window.

I need a rectangle in my settings window to display a scaled down version of of the main window. This is the non-working code that I have right now. Is it possible to do what I want to do? <Rectangle.Fill> <VisualBrush Stretch="Uniform" Visual="{Binding ElementName=local:MainWindow}" /> </Rectangle.Fill> ...

MVVM- Is there any way I can bind the visual of a visual brush to another window?

I have a settings window and am trying to set it up so that there is a live preview what the main window will look like with the current settings. Here is a picture of what the settings dialog looks like at the moment. The big black rectangle will be the preview. ...

RenderTargetBitmap + Resource'd VisualBrush = incomplete image

I've found a new twist on the "Visual to RenderTargetBitmap" question! I'm rendering previews of WPF stuff for a designer. That means I need to take a WPF visual and render it to a bitmap without that visual ever being displayed. Got a nice little method to do it like to see it here it goes private static BitmapSource CreateBitmapSou...

WPF: Convert VisualBrush to Drawing?

Hello, I have a VisualBrush and need this VisualBrush as a Drawing. Anyone knows how this can be done? Thanks for any hint! ...

Can controls rendered within a wpf Viewport3D using a VisualBrush fire their specific events?

Hi, I'm trying to render a Button on a GeometryModel3D by using a VisualBrush. Is there a way I can handle the button's click event directly? (or is it that the VisualBrush only renders the image of a button and I am supposed to use the VisualTree in order to check if the button was pressed? ) Thanks! ...