欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)[5篇材料]

      時(shí)間:2019-05-12 11:24:34下載本文作者:會(huì)員上傳
      簡(jiǎn)介:寫寫幫文庫小編為你整理了多篇相關(guān)的《C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)》,但愿對(duì)你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)》。

      第一篇:C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)

      C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)

      2011-05-03 12:37 1265人閱讀 評(píng)論(2)收藏 舉報(bào)

      c#floatimageobjectstringnull

      /////////////用到的命名空間////////////

      using System.Drawing;using System.Drawing.Drawing2D;using System.Drawing.Imaging;

      /////兩張圖片疊加,float fImage(0—1)透明度///////////////

      private void getMixImage(float fImage, string strFrontImage, string strBackImage){ this.m_image.Dispose();Bitmap background = new Bitmap(strBackImage);Bitmap frontImage = new Bitmap(strFrontImage);int iwidth = background.Width > frontImage.Width ? background.Width : frontImage.Width;int iheight = background.Height > frontImage.Height ? background.Height : frontImage.Height;Bitmap mixImage2 = new Bitmap(iwidth, iheight);//this.mixImage.Width = iwidth;//this.mixImage.Height = iheight;Graphics g = Graphics.FromImage(mixImage2);float[][] colormatrix ={ new float[]{1,0,0,0,0},//代表了R new float[]{0,1,0,0,0},//代表了G new float[]{0,0,1,0,0},//代表了B new float[]{0,0,0,fImage,0},//代表了A new float[]{0,0,0,0,1} };ColorMatrix cm = new ColorMatrix(colormatrix);ImageAttributes imageAtt = new ImageAttributes();imageAtt.SetColorMatrix(cm, ColorMatrixFlag.Default, ColorAdjustType.Bitmap);g.DrawImage(background, new Point(0, 0));g.DrawImage(frontImage, new Rectangle(0, 0, frontImage.Width, frontImage.Height), 0, 0, frontImage.Width, frontImage.Height, GraphicsUnit.Pixel, imageAtt);this.pictureBox1.Image = mixImage2;this.pictureBox1.Update();this.m_ChangeSize = mixImage2;}

      //////////////圖片的縮放/////////////

      public Form1(){ InitializeComponent();/////////////寫在初始化時(shí),提高運(yùn)算速度////////////

      base.SetStyle(ControlStyles.OptimizedDoubleBuffer |ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);base.SetStyle(ControlStyles.ResizeRedraw | ControlStyles.Selectable, true);} /////////////放大////////////

      private void buttonPicSizeEnlarge_Click(object sender, EventArgs e){ this.nPicSize++;if(this.nPicSize < 1){ this.nPicSize = 1;MessageBox.Show(“無法再減弱”);} if(this.nPicSize > 6){ MessageBox.Show(“無法再增強(qiáng)”);this.nPicSize = 6;} else {

      this.picSizeColor();if(this.nReset == 0)m_image = m_Reset;if(this.pictureBox1.Image.Width > this.splitContainer1.Panel1.Width && this.pictureBox1.Image.Height > this.splitContainer1.Panel1.Height && pictureBox1.Image.Height >= m_image.Height * 4){ MessageBox.Show(“已是最大”);} else { this.nReset = this.nReset + 1;Rectangle oldrct;Bitmap bmp =(Bitmap)this.pictureBox1.Image;oldrct = new Rectangle(0, 0, bmp.Width, bmp.Height);this.pictureBox1.Image = bmp;Bitmap tmpbmp = null;tmpbmp = new Bitmap(bmp.Width * 2, bmp.Height * 2);if(bmp.Width < m_image.Width){ oldrct = new Rectangle(0, 0, m_image.Width, m_image.Height);Graphics g = Graphics.FromImage(tmpbmp);Rectangle newrct = new Rectangle(0, 0, tmpbmp.Width, tmpbmp.Height);g.DrawImage(m_image, newrct, oldrct, GraphicsUnit.Pixel);g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;pictureBox1.Image = tmpbmp;g.Dispose();pictureBox1.Update();} else { Graphics g = Graphics.FromImage(tmpbmp);Rectangle newrct = new Rectangle(0, 0, tmpbmp.Width, tmpbmp.Height);g.DrawImage(bmp, newrct, oldrct, GraphicsUnit.Pixel);g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic;pictureBox1.Image = tmpbmp;g.Dispose();pictureBox1.Update();} } this.m_image =(Bitmap)this.pictureBox1.Image;} }

      /////////////縮小////////////

      private void buttonPicSizeNarrow_Click(object sender, EventArgs e){ this.nPicSize--;if(this.nPicSize < 1){ this.nPicSize = 1;MessageBox.Show(“無法再縮小”);} if(this.nPicSize > 6){ MessageBox.Show(“無法再增大”);this.nPicSize = 6;} else { this.picSizeColor();if(this.nReset == 0)m_image = m_Reset;if(pictureBox1.Image.Width <= this.splitContainer1.Panel1.Width && pictureBox1.Image.Height <= this.splitContainer1.Panel1.Height){ MessageBox.Show(“已經(jīng)最小”);} else { this.nReset = this.nResettmpbmp.Width;M_int_maxY = pictureBox1.HeightM_pot_p.X + e.X;M_int_my = M_int_my-M_pot_p.Y + e.Y;//鎖定范圍

      M_int_mx = Math.Min(0, Math.Max(M_int_maxX, M_int_mx));M_int_my = Math.Min(0, Math.Max(M_int_maxY, M_int_my));Graphics g = pictureBox1.CreateGraphics();g.DrawImage(tmpbmp, new Rectangle(0, 0, pictureBox1.Width, pictureBox1.Height), new Rectangle(-M_int_mx,-M_int_my, pictureBox1.Width, pictureBox1.Height), GraphicsUnit.Pixel);M_pot_p = e.Location;} else { Cursor = Cursors.Default;} }

      下載C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)[5篇材料]word格式文檔
      下載C#圖片處理總結(jié)——疊加、縮放、鼠標(biāo)拖動(dòng)[5篇材料].doc
      將本文檔下載到自己電腦,方便修改和收藏,請(qǐng)勿使用迅雷等下載。
      點(diǎn)此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn)自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進(jìn)行舉報(bào),并提供相關(guān)證據(jù),工作人員會(huì)在5個(gè)工作日內(nèi)聯(lián)系你,一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦