BitmapImage.SetPixel(Int32, Int32, Color) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for