Skip to content

Instantly share code, notes, and snippets.

@mckelvin
Last active December 14, 2015 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mckelvin/5011018 to your computer and use it in GitHub Desktop.
Save mckelvin/5011018 to your computer and use it in GitHub Desktop.
//简单去边框
public static Bitmap setBoundWhite(Bitmap bmap){
Bitmap image = new Bitmap(bmap);
int i, Height = image.Height,Width =image.Width;
//去边框
for (i = 0; i < Width; i++)
{
image.SetPixel(i, 0, Color.White);
image.SetPixel(i, Height - 1, Color.White);
}
//去边框
for (i = 0; i < Height; i++)
{
image.SetPixel(0, i, Color.White);
image.SetPixel(Width - 1, i, Color.White);
}
return image;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment