91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 1.47KB
    文件類型: .cs
    金幣: 1
    下載: 0 次
    發布日期: 2020-12-26
  • 語言: C#
  • 標簽: C#??

資源簡介

c# 圖片旋轉任意角度的函數

資源截圖

代碼片段和文件信息

#region?圖片旋轉任意角度的函數
///?
///?以逆時針為方向對圖像進行旋轉
///?

///?位圖流
///?旋轉角度[0360](前臺給的)
///?
public?Bitmap?Rotate(Bitmap?b?int?angle)
{
angle?=?angle?%?360;?//弧度轉換
double?radian?=?angle?*?Math.PI?/?180.0;
double?cos?=?Math.Cos(radian);
double?sin?=?Math.Sin(radian);
//原圖的寬和高
int?w?=?b.Width;
int?h?=?b.Height;
int?W?=?(int)(Math.Max(Math.Abs(w?*?cos?-?h?*?sin)?Math.Abs(w?*?cos?+?h?*?sin)));
int?H?=?(int)(Math.Max(Math.Abs(w?*?sin?-?h?*?cos)?Math.Abs(w?*?sin?+?h?*?cos)));
//目標位圖
Bitmap?dsImage?=?new?Bitmap(W?H);
System.Drawing.Graphics?g?=?System.Drawing.Graphics.FromImage(dsImage);
g.Int

評論

共有 條評論