The above articles on C # digital image processing are all transferred from the column k1381.
Http://blog.csdn.net/ki1381/category/240835.aspx? Pagenumber = 1
Thank you !!
Occasionally, digital photos are being taken. It doesn't matter. We can still use C # To process images.
/// <Summary>
/// Rotate at any angle
/// </Summary>
/// <Param name = "BMP"> original map bitmap </param>
/// <Param name = "angle"> Rotation Angle </param>
/// <Param name = "bkcolor"> background color </param>
/// <Returns> output bitmap </returns>
Public static bitmap kirotate (bitmap BMP, float angle, color bkcolor)
...{
Int W = BMP. Width + 2;
Int H = BMP. height + 2;
Pixelformat PF;
If (bkcolor = color. Transparent)
...{
PF = pixelformat. format32bppargb;
}
Else
...{
PF = BMP. pixelformat;
}
Bitmap TMP = new Bitmap (W, H, Pf );
Graphics G = graphics. fromimage (TMP );
G. Clear (bkcolor );
G. drawimageunscaled (BMP, 1, 1 );
G. Dispose ();
Graphicspath Path = new graphicspath ();
Path. addrectangle (New rectanglef (0f, 0f, W, h ));
Matrix mtrx = new matrix ();
Mtrx. Rotate (angle );
Rectanglef RDBMS = path. getbounds (mtrx );
Bitmap DST = new Bitmap (INT) RDBMS. Width, (INT) RDBMS. Height, Pf );
G = graphics. fromimage (DST );
G. Clear (bkcolor );
G. translatetransform (-RDBMS. X,-RDBMS. y );
G. rotatetransform (angle );
G. interpolationmode = interpolationmode. highqualitybilinear;
G. drawimageunscaled (TMP, 0, 0 );
G. Dispose ();
TMP. Dispose ();
Return DST;
}
In the recent forum, it seems that C # is not suitable for image processing. My point is: if it is not highly real-time, otherwise C # is competent.
I made a C # personal digital photo processing tool with satisfactory processing speed. Except that Gaussian Blur is a little slow, everything else is very fast.
Of course, the premise is either bitmapdata or GDI +. In short, getpixel/setpixel cannot be used.