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

  • 大小: 687KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2023-08-01
  • 語言: C#
  • 標簽: 圖片顏色??

資源簡介

分析圖片顏色分布所占比例,利用rgb函數(shù)獲取圖片的所有像素,進行計算。

資源截圖

代碼片段和文件信息

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.Collections;
using?System.Runtime.InteropServices;
using?System.Diagnostics;


namespace?ColorStatistics
{
????public?partial?class?FrmTest?:?Form
????{
????????public?FrmTest()
????????{
????????????InitializeComponent();
????????}

????????List?MC;
????????int?PixelAmount?=?0;

????????private?void?CmdOpen_Click(object?sender?EventArgs?e)
????????{
????????????OpenFileDialog?openFileDialog?=?new?OpenFileDialog();
????????????openFileDialog.FilterIndex?=?4;
????????????openFileDialog.RestoreDirectory?=?true;
????????????if?(openFileDialog.ShowDialog()?==?DialogResult.OK)
????????????{
????????????????Thumb.Image?=??(Bitmap)Bitmap.FromFile(openFileDialog.FileName);
??????????????
????????????}
????????}
????????public?static?Color?IntToColor(int?color)
????????{
????????????int?R?=?color?&?255;
????????????int?G?=?(color?&?65280)?/?256;
????????????int?B?=?(color?&?16711680)?/?65536;
????????????return?Color.FromArgb(255?R?G?B);
????????}

????????private?void?PicR_Click(object?sender?EventArgs?e)
????????{

????????}

????????private?void?PicR_Paint(object?sender?PaintEventArgs?e)
????????{
????????????if?(MC?!=?null)
????????????{
????????????????e.Graphics.Clear(PicR.BackColor);
????????????????Font?font?=?new?Font(“宋體“?9f);
????????????????SolidBrush?B?=?new?SolidBrush(Color.Black);
????????????????e.Graphics.DrawString(“??????顏色????????“?font?B?new?PointF(0?0));
????????????????e.Graphics.DrawString(“?????百分比??????“?font?B?new?PointF(120?0));
????????????????e.Graphics.DrawString(“數(shù)量“?font?B?new?PointF(250?0));
????????????????B.Dispose();
????????????????for?(int?i?=?0;?i?????????????????{
????????????????????B?=?new?SolidBrush(IntToColor(MC[i].Color));
????????????????????e.Graphics.FillRectangle(B?new?Rectangle(0?(i?+?1)?*?20?100?15));
????????????????????e.Graphics.DrawString(((double)MC[i].Amount?/?PixelAmount).ToString()?font?B?new?PointF(120?(i?+?1)?*?20?+?3));
????????????????????e.Graphics.DrawString(MC[i].Amount.ToString()?font?B?new?PointF(250?(i?+?1)?*?20?+?3));
????????????????????B.Dispose();
????????????????}
????????????????font.Dispose();
????????????}
????????}

????????private?void?CmdDeal_Click(object?sender?EventArgs?e)
????????{
???????????
????????????if?(Thumb.Image?!=null?)?
????????????{
????????????????Stopwatch?Sw?=?new?Stopwatch();
????????????????Sw.Start();
????????????????MC?=?Statistics.PrincipalColorAnalysis((Bitmap)Thumb.ImageSliderColorAmount.Value?SliderDelta.Value);
????????????????Sw.Stop();
????????????????LblStatus.Text???=?“計算主成分用時:?“??+Sw.ElapsedMilliseconds.ToString()?+?“?毫秒“;
????????????????PixelAmount?=?Thumb.Image.Width?*?Thumb.Image.Height;
?????

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

?????文件??????11600??2013-06-20?21:07??ColorStatistics\bin\Debug\ColorStatistics.vshost.exe

?????文件????????490??2010-03-17?22:39??ColorStatistics\bin\Debug\ColorStatistics.vshost.exe.manifest

?????文件?????773120??2013-06-23?10:23??ColorStatistics\bin\Release\ColorStatistics.exe

?????文件??????32256??2013-06-23?10:23??ColorStatistics\bin\Release\ColorStatistics.pdb

?????文件??????11600??2013-07-11?14:27??ColorStatistics\bin\Release\ColorStatistics.vshost.exe

?????文件????????490??2010-03-17?22:39??ColorStatistics\bin\Release\ColorStatistics.vshost.exe.manifest

?????文件???????5893??2013-06-23?10:22??ColorStatistics\ColorStatistics.csproj

?????文件????????478??2013-06-23?10:22??ColorStatistics\ColorStatistics.csproj.user

?????文件???????3547??2013-07-11?14:38??ColorStatistics\FrmTest.cs

?????文件???????9414??2013-06-23?10:23??ColorStatistics\FrmTest.Designer.cs

?????文件?????546895??2013-06-23?10:23??ColorStatistics\FrmTest.resx

?????文件???????6262??2013-06-20?21:11??ColorStatistics\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache

?????文件???????1067??2013-07-11?14:27??ColorStatistics\obj\x86\Release\ColorStatistics.csproj.FileListAbsolute.txt

?????文件?????773120??2013-06-23?10:23??ColorStatistics\obj\x86\Release\ColorStatistics.exe

?????文件?????361084??2013-06-23?10:23??ColorStatistics\obj\x86\Release\ColorStatistics.FrmTest.resources

?????文件??????32256??2013-06-23?10:23??ColorStatistics\obj\x86\Release\ColorStatistics.pdb

?????文件??????37013??2013-06-23?10:22??ColorStatistics\obj\x86\Release\ColorStatistics.Properties.Resources.resources

?????文件???????4440??2013-06-21?16:23??ColorStatistics\obj\x86\Release\DesignTimeResolveAssemblyReferences.cache

?????文件???????6646??2013-07-11?14:14??ColorStatistics\obj\x86\Release\DesignTimeResolveAssemblyReferencesInput.cache

?????文件???????1092??2013-06-23?10:23??ColorStatistics\obj\x86\Release\GenerateResource.read.1.tlog

?????文件???????1498??2013-06-23?10:23??ColorStatistics\obj\x86\Release\GenerateResource.write.1.tlog

?????文件???????7897??2013-06-21?16:37??ColorStatistics\obj\x86\Release\ResolveAssemblyReference.cache

?????文件???????5120??2013-06-23?10:18??ColorStatistics\obj\x86\Release\TempPE\Properties.Resources.Designer.cs.dll

?????文件???????1406??2013-06-23?10:21??ColorStatistics\PanelTime.ico

?????文件????????498??2013-06-23?09:27??ColorStatistics\Program.cs

?????文件???????1362??2013-06-20?21:07??ColorStatistics\Properties\AssemblyInfo.cs

?????文件???????3212??2013-06-23?10:18??ColorStatistics\Properties\Resources.Designer.cs

?????文件???????6291??2013-06-23?10:18??ColorStatistics\Properties\Resources.resx

?????文件???????1100??2013-06-20?21:07??ColorStatistics\Properties\Settings.Designer.cs

?????文件????????249??2013-06-20?21:07??ColorStatistics\Properties\Settings.settings

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

評論

共有 條評論

相關資源