資源簡介
一個小型的.net畫圖程序的源代碼,比較清楚,適合新手學習gdi使用。

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Text;
namespace?PhotoSprite
{
??///?
??///?圖像處理歷史記錄
??///?
??public?class?HistoryImage
??{
????private?int?current?=?-1;
????private?string?[]?History;
????private?string?initDirectory?=?““;
????private?int?max?=?0;
????private?int?count?=?0;
????private?int?save?=?-1;
????///?
????///?獲取或設置初始化文件目錄
????///?
????public?string?InitDirectory
????{
??????get
??????{
????????return?initDirectory;
??????}
??????set
??????{
????????initDirectory?=?value;
??????}
????}
????///?
????///?獲取?bool?值,指示是否可以撤消
????///?
????public?bool?CanUndo
????{
??????get
??????{
????????if?(current?>?0)
??????????return?true;
????????else
??????????return?false;
??????}
????}
????///?
????///?獲取?bool?值,指示是否可以重復
????///?
????public?bool?CanRedo
????{
??????get
??????{
????????if?(current???????????return?true;
????????else
??????????return?false;
??????}
????}
????///?
????///?獲取?bool?值,指示圖像是否已經修改過
????///?
????public?bool?IsDirty
????{
??????get
??????{
????????if?(current?!=?save)
??????????return?true;
????????else
??????????return?false;
??????}
????}
????///?
????///?獲取最大歷史記錄數
????///?
????public?int?Max
????{
??????get
??????{
????????return?max;
??????}
????}
????///?
????///?獲取當前已記錄的最大歷史記錄數
????///?
????public?int?Count
????{
??????get
??????{
????????return?count;
??????}
????}
????///?
????///?獲取或設置當前圖像文件
????///?
????public?int?Current
????{
??????get
??????{
????????return?current;
??????}
??????set
??????{
????????current?=?value;
????????//?隊列循環
????????if?(current?0)
????????{
??????????if?(count?????????????current?=?0;
??????????else
????????????current?=?max?-?1;
????????}
????????else?if?(current?>=?max)
????????{
??????????current?=?0;
??????????count?=?max;
????????}
????????if?(current?>=?count)
??????????count?=?current?+?1;
????????OnHistoryChanged();
??????}
????}
????///?
????///?獲取當前圖像文件名
????///?
????public?string?CurrentImage
????{
??????get
??????{
????????if?(current?>=?0)
??????????return?History[current];
????????else
??????????return?““;
??????}
????}
????///?
????///?獲取下一個圖像文件名
????///?
????public?string?NextImage
????{
??????get
??????{
????????int?next?=?(current?+?1)?%?max;
????????return?History[next];
??????}
????}
????///?
????///?建立歷史記錄類
????///?
????///?初始化文件目錄
????///?統計次數
????public?HistoryImage(string?initDirectory?int?max)
????{
??????this.initDirectory?=?initDirectory;
??????this.max?=?max;
??????History?=?new?string[max];
??????for?(int?i?=?0;?i???????{
????????History
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.????258560??2017-12-22?17:46??PhotoSprite\.vs\PhotoSprite\v14\.suo
?????文件???????4312??2002-01-01?09:48??PhotoSprite\Backup\ColorSpace\CMYK.cs
?????文件???????4407??2002-01-01?09:48??PhotoSprite\Backup\ColorSpace\HSI.cs
?????文件???????5357??2002-01-01?09:48??PhotoSprite\Backup\ColorSpace\HSL.cs
?????文件???????6106??2002-01-01?09:48??PhotoSprite\Backup\ColorSpace\HSV.cs
?????文件???????4258??2002-01-01?09:48??PhotoSprite\Backup\ColorSpace\YUV.cs
?????文件???????4152??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AboutBox.cs
?????文件???????9219??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AboutBox.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AboutBox.resx
?????文件???????3623??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AdvancedDialog.cs
?????文件???????5625??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AdvancedDialog.Designer.cs
?????文件???????6219??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AdvancedDialog.resx
?????文件???????3637??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AngleDialog.cs
?????文件???????5038??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AngleDialog.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\AngleDialog.resx
?????文件????????749??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ArtStringDialog.cs
?????文件???????7232??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ArtStringDialog.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ArtStringDialog.resx
?????文件???????2425??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorBalanceDialog.cs
?????文件??????10212??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorBalanceDialog.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorBalanceDialog.resx
?????文件???????9995??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorPickerDialog.cs
?????文件??????19670??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorPickerDialog.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\ColorPickerDialog.resx
?????文件???????8618??2002-01-01?09:48??PhotoSprite\Backup\Dialog\CustomDialog.cs
?????文件??????16680??2002-01-01?09:48??PhotoSprite\Backup\Dialog\CustomDialog.Designer.cs
?????文件???????6219??2002-01-01?09:48??PhotoSprite\Backup\Dialog\CustomDialog.resx
?????文件???????6795??2002-01-01?09:48??PhotoSprite\Backup\Dialog\DegreeDialog.cs
?????文件???????5284??2002-01-01?09:48??PhotoSprite\Backup\Dialog\DegreeDialog.Designer.cs
?????文件???????5814??2002-01-01?09:48??PhotoSprite\Backup\Dialog\DegreeDialog.resx
............此處省略454個文件信息
評論
共有 條評論