Skip to content

Image.TryPeekColor method

Tries to read the source pixel color at the given position (local DIPs).

public bool TryPeekColor(Point positionDip, out Color color)

This reads pixels from the decoded ImageSource data (BGRA32) and maps the position through Viewbox, StretchMode, and alignment. Returns false if the source is not an ImageSource, decoding fails, or the position maps outside the source.