RenderTargetBitmap doesn't seem to render my rectangle
问题 I have the following code: LinearGradientBrush linGrBrush = new LinearGradientBrush(); linGrBrush.StartPoint = new Point(0,0); linGrBrush.EndPoint = new Point(1, 0); linGrBrush.GradientStops.Add(new GradientStop(Colors.Red, 0.0)); linGrBrush.GradientStops.Add(new GradientStop(Colors.Yellow, 0.5)); linGrBrush.GradientStops.Add(new GradientStop(Colors.White, 1.0)); Rectangle rect = new Rectangle(); rect.Width = 1000; rect.Height = 1; rect.Fill = linGrBrush; rect.Arrange(new Rect(0, 0, 1, 1000))