Questions tagged [imagebrush]

92 questions
1
vote
0 answers

stroke imagebrush windows store apps

I am using imagebrush as stroke when i draw polyline. var bitmapImage = new Windows.UI.Xaml.Media.Imaging.BitmapImage(new Uri("ms-appx:/Assets/br1.png")); img = new Windows.UI.Xaml.Media.ImageBrush() { ImageSource =…
Z_Metro
  • 11
  • 3
1
vote
0 answers

Get white Background when I Load transparent png image in WPF rectangle background?

When I load a transparent png image with ImageBrush in WPF Rectangle background, I get a white background behind the image. It hides all other content back to that image. public void DisplayModel() { Uri url = new…
Lazy Lion
  • 821
  • 2
  • 9
  • 18
1
vote
1 answer

WPF - ImageBrush with PNG, not respecting alpha-channel

I want to use an ImageBrush to use in the Rectangle.Fill. The file is a .PNG. It comes out looking like it is sitting on a little gray pad. The ImageBrush is returned from a converter with something like this: BitmapImage image = new…
jeff
  • 3,269
  • 3
  • 28
  • 45
1
vote
2 answers

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. If I set it using a…
Carlos G.
  • 4,564
  • 4
  • 34
  • 57
1
vote
1 answer

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: How can I move this to code-behind,…
Edward Tanguay
  • 189,012
  • 314
  • 712
  • 1,047
0
votes
1 answer

Resize image for use as an image brush

I want to load an image from a resource Set the image width, ensuring that it scales it's height proportionally. Use it as a background brush It can't figure out the "setting its width" part. The compromise I'm currently using is to scale it to…
Andrew Shepherd
  • 44,254
  • 30
  • 139
  • 205
0
votes
2 answers

How to set border background imagebrush in code-behind

I have a WPF custom user control that is used in a Windows Application. The control has a border as the main element, and this border has a default background image. The code below shows how this image is set as a default. The default image is a…
Fritz45
  • 752
  • 1
  • 10
  • 23
0
votes
0 answers

When clicking on image brush in code, visual studio freezes

When clicking on image brush in code, Visual Studio freezes and crashes. Here is the code that worked but at one point it stopped working:
daMpik
  • 13
  • 5
0
votes
1 answer

cannot open imagesource with relative with relative path

I need some help with imagebrush it only works with absolute directories for example works fine but this
0
votes
1 answer

How can I make the background of my custom brush transparent?

I wanted to draw on the canvas with the code below with my custom brush, but as you can see in the picture, the background of my brush is black, albeit without color. Although I specified the brush color as Color.TRANSPARENT or Color.parseColor ("#…
user14988618
0
votes
1 answer

3D object with texture invisible

I simply want to texture a 3D object with an image (texture file here). For this purpose I use the System.Windows.Media3D stuff. My Problem is that a cube is not textured with an image. When I draw the cube with a SolidColorBrush, the cube is…
Noran
  • 54
  • 9
0
votes
1 answer

bitmap loaded memory increase 10x the size of the file

I am loading an image and i get an increase of memory around 10x the size of the file. this is the output for the code below Loading file img_6.jpg with originally 513kb Memory for image img_6.jpg is 63704kb (124.12x) Thanks! this is the code i use…
l2rek
  • 32
  • 1
  • 5
0
votes
1 answer

Is it possible to turn off antialiasing when using ImageBrush tiling?

Is it possible to turn off anti-aliasing in WPF when using an ImageBrush? Given the following code: var handleImage = new BitmapImage(new Uri($"pack://application:,,,/Resources/myimage.png")); var imageBrush = new…
Michael Brown
  • 1,585
  • 1
  • 22
  • 36
0
votes
0 answers

How to change any shape (ex rectangle ...) Fill using Inline IF

I try this code bellow, but without any result, could you please tell my why? I have a rectangle shape in WPF C#, which’s filled with an imagebrush as you see, and I used inline if, but it doesn’t worked as I planed… Rec1.Fill = Rec1.Fill == (new…
Aso Salih
  • 1
  • 1
0
votes
1 answer

How to implement a imagebrush size in android

I am new to android development. I have started implementing paint related app. In that i wanted the user to select the brush size which is shown on a bar. I mean on pressing '+' button it should increase the brush size and move slightly on the bar…