Skip to content

BitmapData SetPixel() #29392

@informatorius

Description

@informatorius

System.Drawing.Bitmap class has a SetPixel() method but it is slow for setting many pixels because each call locks in bitmap in the kernel. That is why Bitmap also has a LockBits() method which locks the bitmap and returns a System.Drawing.Imaging.BitmapData for direct manipulation.

The problem is this BitmapData class has no easy method for SetPixel() but you need to calculate with IntPtr and stride values.

I wish extension methods in System.Drawing.Imaging for BitmapData which allow fast SetPixel() for many pixels

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions