// Constructor. public Glyph(char character, Bitmap bitmap, Rectangle? subrect = null) { this.Character = character; this.Bitmap = bitmap; this.Subrect = subrect.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height)); }
// Constructor locks the bitmap. public PixelAccessor(Bitmap bitmap, ImageLockMode mode, Rectangle? region = null) { this.bitmap = bitmap; this.Region = region.GetValueOrDefault(new Rectangle(0, 0, bitmap.Width, bitmap.Height)); this.data = bitmap.LockBits(Region, mode, PixelFormat.Format32bppArgb); }