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

  • 大小: 950KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-05
  • 語言: C#
  • 標簽: 代碼??

資源簡介

本人分享一個完整的C#磨皮濾鏡代碼DEMO,效果很贊,磨皮的同時,保留了一定的細節(jié),跟大家分享一下!

資源截圖

代碼片段和文件信息

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

namespace?TestDemo
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????????string?startupPath?=?System.Windows.Forms.Application.StartupPath;
????????????lege_map?=?new?Bitmap(startupPath?+?@“\map_lege.png“);
????????}

????????#region??變量聲明
????????//圖像路徑
????????private?String?curFileName?=?null;
????????//當前圖像變量
????????private?Bitmap?curBitmap?=?null;
????????//原始圖像變量
????????private?Bitmap?srcBitmap?=?null;
????????//
????????ImageFilter?imfilter?=?new?ImageFilter();
????????private?Bitmap?lege_map?=?null;
????????#endregion

????????#region??圖像打開保存模塊
????????//打開圖像函數
????????public?void?OpenFile()
????????{
????????????OpenFileDialog?ofd?=?new?OpenFileDialog();
????????????ofd.Filter?=?“所有圖像文件?|?*.bmp;?*.pcx;?*.png;?*.jpg;?*.gif;“?+
???????????????????“*.tif;?*.ico;?*.dxf;?*.cgm;?*.cdr;?*.wmf;?*.eps;?*.emf|“?+
???????????????????“位圖(?*.bmp;?*.jpg;?*.png;...)?|?*.bmp;?*.pcx;?*.png;?*.jpg;?*.gif;?*.tif;?*.ico|“?+
???????????????????“矢量圖(?*.wmf;?*.eps;?*.emf;...)?|?*.dxf;?*.cgm;?*.cdr;?*.wmf;?*.eps;?*.emf“;
????????????ofd.ShowHelp?=?true;
????????????ofd.title?=?“打開圖像文件“;
????????????if?(ofd.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????curFileName?=?ofd.FileName;
????????????????try
????????????????{
????????????????????curBitmap?=?(Bitmap)System.Drawing.Image.FromFile(curFileName);
????????????????????srcBitmap?=?new?Bitmap(curBitmap);
????????????????}
????????????????catch?(Exception?exp)
????????????????{?MessageBox.Show(exp.Message);?}
????????????}
????????}
????????//保存圖像函數
????????public?void?SaveFile()
????????{
????????????SaveFileDialog?sfd?=?new?SaveFileDialog();
????????????sfd.Filter?=?“PNG文件(*.png)|*.png“;
????????????if?(sfd.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????pictureBox1.Image.Save(sfd.FileName?ImageFormat.Png);
????????????}

????????}
????????//打開圖像
????????private?void?openBtn_Click(object?sender?EventArgs?e)
????????{
????????????OpenFile();
????????????if?(curBitmap?!=?null)
????????????{
????????????????pictureBox1.Image?=?(Image)curBitmap;
????????????}
????????}
????????//保存圖像
????????private?void?saveBtn_Click(object?sender?EventArgs?e)
????????{
????????????if?(pictureBox1.Image?!=?null)
????????????????SaveFile();
????????}
????????#endregion

????????//確定
????????private?void?okBtn_Click(object?sender?EventArgs?e)
????????{
????????????if?(pictureBox1.Image?!=?null)
????????????{
????????????????int?radius?=??Convert.ToInt32(textBox1.Text.ToString());
????????????????if?(radius?>=?0?&&?radius?<=?20)
????????????????{
????????????????????pictureBox1.Image?=?(Image)imfilter.SoftSkinFilter(curBitmap

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2015-12-14?10:07??磨皮濾鏡特效\
?????文件??????269090??2015-11-07?15:18??磨皮濾鏡特效\Test.png
?????目錄???????????0??2015-12-14?10:07??磨皮濾鏡特效\TestDemo\
?????目錄???????????0??2015-12-08?09:57??磨皮濾鏡特效\TestDemo\TestDemo\
?????文件????????1534??2015-12-08?09:55??磨皮濾鏡特效\TestDemo\TestDemo.sln
?????目錄???????????0??2015-12-08?11:00??磨皮濾鏡特效\TestDemo\TestDemo\bin\
?????目錄???????????0??2015-12-08?10:28??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\
?????文件???????12517??2015-10-21?16:19??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\hisbmp.jpg
?????文件????????3378??2015-12-08?10:00??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\map_lege.png
?????文件???????55808??2015-10-21?15:11??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\pthreadVC2.dll
?????文件???????26112??2015-12-14?10:05??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo.exe
?????文件???????56832??2015-12-14?10:05??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo.pdb
?????文件???????11600??2015-05-05?11:41??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo.vshost.exe
?????文件?????????490??2013-03-18?17:00??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo.vshost.exe.manifest
?????文件???????24576??2015-05-05?11:50??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo_C.dll
?????文件?????????406??2015-05-05?11:50??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo_C.dll.manifest
?????文件??????260468??2015-05-05?11:50??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo_C.ilk
?????文件??????756736??2015-05-05?11:50??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\TestDemo_C.pdb
?????文件??????203776??2015-12-06?14:59??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\ZEffectEngine.dll
?????文件???????88576??2015-12-06?14:58??磨皮濾鏡特效\TestDemo\TestDemo\bin\Debug\ZPhotoEngine.dll
?????目錄???????????0??2015-12-08?11:03??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\
?????文件???????12517??2015-10-21?16:19??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\hisbmp.jpg
?????文件????????3378??2015-12-08?10:00??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\map_lege.png
?????文件???????55808??2015-10-21?15:11??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\pthreadVC2.dll
?????文件???????25600??2015-12-14?10:04??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\TestDemo.exe
?????文件???????48640??2015-12-14?10:04??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\TestDemo.pdb
?????文件???????11600??2015-12-14?10:05??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\TestDemo.vshost.exe
?????文件?????????490??2013-03-18?17:00??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\TestDemo.vshost.exe.manifest
?????文件???????24576??2015-05-05?11:50??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\TestDemo_C.dll
?????文件??????203776??2015-12-06?14:59??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\ZEffectEngine.dll
?????文件???????88576??2015-12-06?14:58??磨皮濾鏡特效\TestDemo\TestDemo\bin\Release\ZPhotoEngine.dll
............此處省略37個文件信息

評論

共有 條評論