CopyData.cs
上传用户:chengzheng
上传日期:2013-08-05
资源大小:38k
文件大小:1k
- using System;
- using System.Runtime.InteropServices;
- namespace Cowburn.Imaging
- {
- internal class CopyData : IDisposable
- {
- public int dwData;
- public int cbData;
- public IntPtr lpData;
- private GCHandle _handle;
- public IntPtr Handle
- {
- get
- {
- if(!_handle.IsAllocated)
- {
- _handle = GCHandle.Alloc(this,GCHandleType.Pinned);
- }
- return _handle.AddrOfPinnedObject();
- }
- }
- #region IDisposable Members
- public void Dispose()
- {
- if(_handle.IsAllocated)
- {
- _handle.Free();
- }
- }
- #endregion
- }
- }