123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132 |
- using System;
- using System.Drawing;
- using System.Drawing.Imaging;
- namespace Microsoft.Drawing
- {
-
-
-
- public sealed class LockedBitmapData : DisposableMini
- {
- private Bitmap m_Bitmap;
- private BitmapData m_BitmapData;
-
-
-
- public PixelFormat PixelFormat
- {
- get
- {
- return this.m_BitmapData.PixelFormat;
- }
- set
- {
- this.m_BitmapData.PixelFormat = value;
- }
- }
-
-
-
- public int Width
- {
- get
- {
- return this.m_BitmapData.Width;
- }
- set
- {
- this.m_BitmapData.Width = value;
- }
- }
-
-
-
- public int Height
- {
- get
- {
- return this.m_BitmapData.Height;
- }
- set
- {
- this.m_BitmapData.Height = value;
- }
- }
-
-
-
- public int Stride
- {
- get
- {
- return this.m_BitmapData.Stride;
- }
- set
- {
- this.m_BitmapData.Stride = value;
- }
- }
-
-
-
- public IntPtr Scan0
- {
- get
- {
- return this.m_BitmapData.Scan0;
- }
- set
- {
- this.m_BitmapData.Scan0 = value;
- }
- }
-
-
-
- public int Reserved
- {
- get
- {
- return this.m_BitmapData.Reserved;
- }
- set
- {
- this.m_BitmapData.Reserved = value;
- }
- }
-
-
-
-
-
-
- public LockedBitmapData(Bitmap bitmap, ImageLockMode flags, PixelFormat format)
- {
- this.m_Bitmap = bitmap;
- Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
- this.m_BitmapData = this.m_Bitmap.LockBits(rect, flags, format);
- }
-
-
-
-
- protected override void Dispose(bool disposing)
- {
- if (this.m_Bitmap != null)
- {
- this.m_Bitmap.UnlockBits(this.m_BitmapData);
- this.m_Bitmap = null;
- this.m_BitmapData = null;
- }
- }
- }
- }
|