imagebrush

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 to assign a dynamic imagebrush resource to a stackpanel's background in code?

I currently define the background for a user control like this: <UserControl.Background> <ImageBrush ImageSource="{DynamicResource LeftMenuBackgroundImage}" /> </UserControl.Background> How can I move this to code-behind, e.g.: PSEUDO-CODE: StackPanel sp = new StackPanel(); sp.Background = new ImageBrush(DynamicResource.GetResou...

Why is my ImageBrush scaling a Tiled image?

I have the following ImageBrush declaration that I want to use to draw the background of a window. <ImageBrush x:Key="Fondo" ImageSource="Fondo.png" Viewport="0,0,0.1,0.1" TileMode="Tile"/> If I set it using a StaticResource binding to the Background property of the Window the brush is rendered correctly, bu...

Silverlight ImageBrush not rendering (with Bing Map Control)

I'm trying to add an image to a Pushpin instance from the Silverlight Bing Map Control, but I can't seem to get it to render (the pushpin renders fine). This is probably a general WPF question rather than anything specific to the Pushpin object. Pushpin pp = new Pushpin(); ... Uri imageUri = new Uri(@"myImage.png", UriKind.Relative); ...

WPF: How do i create a background that repeats horizontally without scalling?

I would like to create a background for my window which is an image that i want repeated horizontally. So far I've tried with the ImageBrush, but this option repeats the image horizonally and vertically. Also, i don't want it to scale when user resize the window, as it makes the image look funny. any ideas? ...

WPF: How to dispose ImageBrush?

I'm using ImageBrush as a background of InkCanvas. I have to dispose the ImageBrush when deleting but the memory still raise up until the program throws an Exception (Out of Memory). I did use freeze Method and making the ImageBrush = null and giving it Empty Source but the memory still raising up. Have you found any solution to dispos...

Silverlight - Binding ImageSource to Rectangle Fill

Blend 4 is telling me this is invalid markup and its not telling me why: <ImageBrush Stretch="Fill" ImageSource="{Binding Avatar, Mode=OneWay}"/> I'm pulling data from a Twitter feed, saving to an ImageSource, and then binding it to an ImageBrush(as seen below) to be used as the Fill for a Rectangle. Here is more context: <Rectangle...

WPF Image Mapping

Is there a way to draw/fit a simple Quadrilateral cut-out from an image onto a standard axis-aligned rectangle for screen display. (So that the cut-out will be distorted to fill the rectangle points). Seems to me it should be possible with an ImageBrush but I cannot quite see it. ...

WPF image offset

I have image with size 800x600 and i need to show small image fragment 90x30 with offset x=12 and y 12. I create brush for that but i dont know how to make offset. var source = new ImageBrush(groundSource); source.Stretch = Stretch.None; source.AlignmentX = AlignmentX.Left; source.Alig...

Clipping Path on an ImageBrush in Silverlight

Is there a way to put a clipping path on an ImageBrush in Silverlight (not an Image)? I don't see it available from Intellisense, but I'm wondering if there may be a way to do this. ...

Cannot find the image by providing the relative path in Silverlight

Hello, I'm working on a Silverlight application and I have a hard time setting the relative path of an image in my application. This is a brief picture of my project directory: MyProject L images L mountain1.jpg L SpriteObjects L MountainFactory.cs L GameScreen.xaml Originally, I painted an Rectangle usi...

WPF : Use different icon images as an ImageBrush?

An Icon can contain more than one image. I want to use an icon for an ImageBrush and I want to set which image inside the icon should be use. But somehow it seems I can't do that. The brush always picks the largest image from the icon. Is there a way to choose the image manually? ...