Get Bitmap Data from Bitmap - CSharp System.Drawing

CSharp examples for System.Drawing:Image Operation

Description

Get Bitmap Data from Bitmap

Demo Code


using System.Drawing.Imaging;
using System.Drawing;
using System.Collections;
using System;/*w w w .  jav  a  2s . c o  m*/

public class Main{
    public static BitmapData GetBitmapData(Bitmap bmp)
      {
         System.Drawing.Imaging.BitmapData bmpData =   bmp.LockBits(
            new Rectangle(0,0,bmp.Width,bmp.Height),
            System.Drawing.Imaging.ImageLockMode.ReadWrite,
            bmp.PixelFormat);
         return bmpData;
      }
}

Related Tutorials