标签:jpg sharp eth ret als 注意 oid class csharp
不太精确的方法:
public bool ThumbnailCallback()
{
return false;
}
private void CreateThumb(int toWidth)
{
System.Drawing.Image.GetThumbnailImageAbort myCallback =
new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback);
Bitmap myBitmap = new Bitmap("D:\\img100.jpg");
double rate = (double)((double)myBitmap.Width / myBitmap.Height );
int toHeight =(int)((double )toWidth / rate);
System.Drawing.Image myThumbnail = myBitmap.GetThumbnailImage(toWidth , toHeight, myCallback, IntPtr.Zero);
myThumbnail.Save("D:\\okThumb.jpg");
}
注意:由于int 和double的问题 无法精确。。。。。。。。。。。。。。。。。
标签:jpg sharp eth ret als 注意 oid class csharp
原文地址:https://www.cnblogs.com/wgscd/p/11378699.html