Questions tagged [lineargradientbrush]

76 questions
1
vote
1 answer

BoxView background gradient not working in .Net Maui

In .Net Maui I creates a new Page and inserted a BoxView, I added a Background Gradient with 2 GradientStops. Tested it on Android and iOS and it does not seem to work.
GeoSaffer
  • 143
  • 12
1
vote
2 answers

How do you get a gradient background to work with bindings in .Net Maui iOS?

I ahve been trying to get Gradients to work in .Net Maui for the last few days on iOS but it seems to be crashing. It works perfectly in Android.
GeoSaffer
  • 143
  • 12
1
vote
0 answers

C# 3D wpf gradient colour depending Z

C# I want to t ouse the LinearGradientBrush with absolute cordinates so the pixel colour of each objects reflactes the height but I do not understand how to use the LinearGradientBrush. But how is this applied to "only" the Z value of each…
Stefan Olsson
  • 617
  • 3
  • 16
  • 32
1
vote
1 answer

binding LinearGradientBrush StartPoint in a custom control

In a previous question kbmax told me how I could bind custom properties in my generic.xaml. This answer was at Setting Border background with a template binding It worked great until I tried to do this with a LinearGradientBrush StartPoint, Here is…
Terco
  • 920
  • 3
  • 19
  • 34
1
vote
1 answer

WPF 3d LinearGardientBrush / TextureCoordinates

I have the following LinearGradientBrush var brush = new LinearGradientBrush(); brush.GradientStops.Add(new GradientStop { Color = Colors.Transparent, Offset = 0 }); brush.GradientStops.Add(new GradientStop { Color = Colors.Blue, Offset = 0.1…
wannensn
  • 255
  • 1
  • 2
  • 6
1
vote
1 answer

Couldnt bind color to LinearGradientBrush

I'm trying this in collection view and i want each item with a different color so I have bound color to GradientStop in xaml like this:
NightWolf
  • 53
  • 3
1
vote
1 answer

How can I set LinearGradientBrush as the background for of ContentPages?

How can I add LinearGradientBrush as ContentPage.Background in App.xaml's ResourceDictionary? My code pasted below:
1
vote
1 answer

WPF - Change background from linear to solid on mouseover

I am testing a button that is initially defined with a two color linear gradient brush that appears horizontally. When the user hovers over the button, I would like to change the gradient to a two color appearing vertically and then revert back to…
Galactic
  • 400
  • 4
  • 14
1
vote
0 answers

LinearGradientBrush with InterpolateColors does not render correctly with small position values

I was trying to make a ColorBlend editor with draggable position marker when I noticed that sometime, it does not seems to render correctly. Using a LinearGradientBrush with an InterpolationColors fading from white to blue to white again and the…
Eric Biron
  • 77
  • 7
1
vote
2 answers

Weird behavior of LinearGradientBrush

I want to fill a Rectangle with a LinearGradientBrush. With some Rectangles I get some strange behavior. Example: Rectangle rect = new Rectangle( 20, 20, 20, 34 ); LinearGradientMode mode = LinearGradientMode.Vertical; Brush brush = new…
EricSchaefer
  • 25,272
  • 21
  • 67
  • 103
1
vote
2 answers

How to get consistent gradient fill in GDI+ when using a rotated LinearGradientBrush?

I'm using GDI+ in my application, and I need to use a rotated LinearGradientBrush to paint several rects in the exact same way. However, although I'm calling the same code to fill each rect, the results aren't what I expect. Here's the code to…
1
vote
1 answer

Apply the opacity of a LinearGradientBrush to an image in winforms

I want to apply the opacity of a linear gradient to an image, but all I have been able to get is the gradient painted on top of the image. Following this stackoverflow post, I created a user control that inherits from PictureBox and I overrode the…
Davide Andrea
  • 1,357
  • 2
  • 15
  • 39
1
vote
1 answer

Direct2D Drawing with DirectX11: Aligning rectangles on a display graph

I'm working on a graphical application in C++ using Direct2d (DirectX11). The application takes in sensor data and displays the input using rectangles that are placed side-by-side across the x-axis (which represents time). Each rectangle is filled…
1
vote
3 answers

Apply Brush to Two Objects At Once

I'd like to apply a Brush (LinearGradientBrush in this case) to two or more objects (TextBlocks) at once. The effect that I'd like is something like this: Edit I cannot simply apply the same brush to both objects, as this will make both of them…
Wonko the Sane
  • 10,623
  • 8
  • 67
  • 92
1
vote
0 answers

WPF Maintain LinearGradientBrush Rotation As Shape Rotates

I'm trying to create a line with a 'barber shop pole' gradient effect in C# (WPF). The code below works, but when I move the line the gradient becomes distorted. Is there a way to move/rotate the line object and have the gradient's angle remain…
Harri Bell-Thomas
  • 674
  • 1
  • 7
  • 18