BitmapImage.SetPixel(Int32, Int32, Color) Method

Definition

Sets pixel at specific position

public abstract void SetPixel (int x, int y, System.Drawing.Color color);
abstract member SetPixel : int * int * System.Drawing.Color -> unit
Public MustOverride Sub SetPixel (x As Integer, y As Integer, color As Color)

Parameters

x
Int32

X coordinate of the pixel

y
Int32

Y coordinate of the pixel

color
Color

Color to set the pixel to

Remarks

The use of SetPixel(Int32, Int32, Color) and GetPixel(Int32, Int32) is usually slow. For fast image updates, grab the underlying raw buffer by calling AsByteSpan() or use the GetDrawingApi() method and use high-level drawing functions.

Applies to