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

  • 大小: 303KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-02
  • 語言: C#
  • 標簽: c#??課程設計??

資源簡介

C#實現將某張照片進行旋轉,目前我添加了可以瀏覽圖片,旋轉18度和26度,若想旋轉其他度數,直接復制button中函數體,修改度數即可。

資源截圖

代碼片段和文件信息

using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.IO;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;

namespace?WindowsFormsApp1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?const?string?IMAGEFILE?=?“G:\\RFID\\1.JPG“;

????????private?static?int?MyAngle?=?0;?//旋轉角度[-360360]??



????????private?void?Page_Load(object?sender?EventArgs?e)

????????{

????????????Image?img;

????????????FileStream?fs;


????????????fs?=?new?FileStream(IMAGEFILE?FileMode.Open?FileAccess.Read);

????????????img?=?Bitmap.FromStream(fs);

????????????fs.Close();

????????????pictureBox1.Image?=?img;

????????}

????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
??????????????
????????????
????????????MyAngle?=?0;

????????????//MyAngle?+=?90;??

????????????//if?(MyAngle?>?360)?MyAngle?=?90;??

????????????pictureBox1.Image?=?RotateImg(GetSourceImg(IMAGEFILE)?MyAngle);

????????}

????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????MyAngle?=?90;

????????????//MyAngle?+=?-90;??

????????????//if?(MyAngle?
????????????//pictureBox1.Image?=?RotateImg(Bitmap.FromFile(IMAGEFILE)?MyAngle);??

????????????pictureBox1.Image?=?RotateImg(IMAGEFILE?MyAngle);
????????}
????????
???????
????????????public?Image?RotateImg(Image?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.InterpolationMode?=?System.Drawing.Drawing2D.InterpolationMode.Bilinear;

????????????g.SmoothingMode?=?System.Drawing.Drawing2D.SmoothingMode.HighQuality;


????????????//計算偏移量??

????????????Point?Offset?=?new?Point((W?-?w)?/?2?(H?-?h)?/?2);


????????????//構造圖像顯示區域:讓圖像的中心與窗口的中心點一致??

????????????Rectangle?rect?=?new?Rectangle(Offset.X?Offset.Y?w?h);

????????????Point?center?=?new?Point(rect.X?+?rect.Width?/?2?rect.Y?+?rect.Height?/?2);


????????????g.TranslateTransform(center.X?center.Y);

????????????g.RotateTransform(360?-?angle);


????????????//恢復圖像在水平和垂直方向的平移??

????????????g.TranslateTransform(-center.X?-center.Y);

????????????g.DrawImage(b?rect);


????????????//重至繪圖的所有變換?

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件?????????22??2019-01-08?00:19??WindowsFormsApp1\.git\COMMIT_EDITMSG

?????文件????????652??2019-01-08?00:19??WindowsFormsApp1\.git\config

?????文件?????????73??2019-01-08?00:19??WindowsFormsApp1\.git\description

?????文件?????????23??2019-01-08?00:19??WindowsFormsApp1\.git\HEAD

?????文件????????478??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\applypatch-msg.sample

?????文件????????896??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\commit-msg.sample

?????文件????????189??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\post-update.sample

?????文件????????424??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\pre-applypatch.sample

?????文件???????1642??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\pre-commit.sample

?????文件???????1348??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\pre-push.sample

?????文件???????4898??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\pre-rebase.sample

?????文件????????544??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\pre-receive.sample

?????文件???????1239??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\prepare-commit-msg.sample

?????文件???????3610??2019-01-08?00:19??WindowsFormsApp1\.git\hooks\update.sample

?????文件???????1342??2019-01-08?00:19??WindowsFormsApp1\.git\index

?????文件????????240??2019-01-08?00:19??WindowsFormsApp1\.git\info\exclude

?????文件????????342??2019-01-08?00:19??WindowsFormsApp1\.git\logs\HEAD

?????文件????????342??2019-01-08?00:19??WindowsFormsApp1\.git\logs\refs\heads\master

?????文件????????150??2019-01-08?00:19??WindowsFormsApp1\.git\ms-persist.xml

?????文件????????309??2019-01-08?00:19??WindowsFormsApp1\.git\objects\15\61dc464c42e1c9ee67b35eb0460758d39c8b2e

?????文件????????751??2019-01-08?00:19??WindowsFormsApp1\.git\objects\1f\f0c423042b46cb1d617b81efb715defbe8054d

?????文件????????186??2019-01-08?00:19??WindowsFormsApp1\.git\objects\25\ac2649af77613e96eae77f6030881daea5ee9a

?????文件????????186??2019-01-08?00:19??WindowsFormsApp1\.git\objects\39\645652af62950ebf3b28ec3a5400dcec30b1c4

?????文件???????2112??2019-01-08?00:19??WindowsFormsApp1\.git\objects\3c\4efe206bd0e7230ad0ae8396a3c883c8207906

?????文件????????491??2019-01-08?00:19??WindowsFormsApp1\.git\objects\43\8df21381ac484a2b9663978736c524d8e8f3bf

?????文件????????718??2019-01-08?00:19??WindowsFormsApp1\.git\objects\51\a5bb977d79c9e57ea68db6ead05a4bd98efc09

?????文件????????201??2019-01-08?00:19??WindowsFormsApp1\.git\objects\58\2c5bbdbf83bf24ef0fe768c23fb62986b509f8

?????文件????????163??2019-01-08?00:19??WindowsFormsApp1\.git\objects\5a\910188ecf4c3e80c90cdbf779e141f6bd565bf

?????文件????????460??2019-01-08?00:19??WindowsFormsApp1\.git\objects\7c\8a6772c734364efa0574cf1fd5ca54ab17e13b

?????文件?????????89??2019-01-08?00:19??WindowsFormsApp1\.git\objects\91\e3470e1645e6e8d0de6fe9f6b242f366e9a393

............此處省略85個文件信息

評論

共有 條評論