Library/ManagedCuda/NPP/NPPImageBase.cs
/// <summary>
/// Copy data from a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
/// </summary>
/// <param name="bitmap"></param>
Copy data from a System.Drawing.Bitmap. There is no check if the bitmap pixel type corresponds to the current NPPImage!
Copy data from a System . Drawing . Bitmap . There is no check if the bitmap pixel type corresponds to the current NPPImage!
public void CopyToDevice(Bitmap bitmap)
		{
			Rectangle rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
			System.Drawing.Imaging.PixelFormat format = bitmap.PixelFormat;
			System.Drawing.Imaging.BitmapData data;
			data = bitmap.LockBits(rect, System.Drawing.Imaging.ImageLockMode.ReadOnly, format);
			try
			{
				CopyToDevice(data.Scan0, Math.Abs(data.Stride));
			}
			finally
			{
				bitmap.UnlockBits(data);
			}
		}
public void CopyToDevice ( Bitmap bitmap ) { Rectangle rect = new Rectangle ( 0 , 0 , bitmap . Width , bitmap . Height ) ; System . Drawing . Imaging . PixelFormat format = bitmap . PixelFormat ; System . Drawing . Imaging . BitmapData data ; data = bitmap . LockBits ( rect , System . Drawing . Imaging . ImageLockMode . ReadOnly , format ) ; try { CopyToDevice ( data . Scan0 , Math . Abs ( data . Stride ) ) ; } finally { bitmap . UnlockBits ( data ) ; } }
Copy data from a System.Drawing.Bitmap.
Copy data from a System . Drawing . Bitmap .
bitmap
Bitmap
None