• 大小: 278KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-25
  • 语言: C#
  • 标签:

资源简介

C#开发的类似PHOTOSHOP的软件

资源截图

代码片段和文件信息

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 < count - 1 && count != 0)
          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 < max)
            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 < max; i++)
      {
        History

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       4355  2006-04-01 03:42  PhotoSprite\History.cs

     文件       2238  2005-12-23 15:05  PhotoSprite\Logo.ICO

     文件      19214  2006-04-05 08:35  PhotoSprite\PhotoSprite.csproj

     文件        603  2006-04-05 08:35  PhotoSprite\PhotoSprite.csproj.user

     文件        910  2005-12-23 14:22  PhotoSprite\PhotoSprite.sln

    ..A..H.    163840  2006-10-12 21:06  PhotoSprite\PhotoSprite.suo

     文件        741  2006-03-04 10:13  PhotoSprite\Program.cs

     文件        279  2006-05-23 17:13  PhotoSprite\Readme.txt

     文件      10364  2006-04-05 08:02  PhotoSprite\WinMain.cs

     文件     182917  2006-04-05 08:02  PhotoSprite\WinMain.Designer.cs

     文件      10094  2006-04-05 06:54  PhotoSprite\WinMain.Menu.Context.cs

     文件      48491  2006-04-05 07:01  PhotoSprite\WinMain.Menu.cs

     文件      29690  2006-04-05 08:02  PhotoSprite\WinMain.resx

     文件      18389  2006-04-05 07:01  PhotoSprite\WinMain.Tool.cs

     文件       3214  2006-03-30 00:02  PhotoSprite\Widget\AngleChooser.cs

     文件       1252  2006-01-10 16:41  PhotoSprite\Widget\AngleChooser.designer.cs

     文件       5814  2006-01-10 16:41  PhotoSprite\Widget\AngleChooser.resx

     文件       5564  2006-04-05 07:50  PhotoSprite\Widget\Canvas.cs

     文件       1717  2006-03-12 10:10  PhotoSprite\Widget\Canvas.Designer.cs

     文件       6016  2006-03-12 10:10  PhotoSprite\Widget\Canvas.resx

     文件       2858  2006-04-05 07:04  PhotoSprite\Widget\layer.cs

     文件       1231  2006-02-16 20:31  PhotoSprite\Widget\layer.Designer.cs

     文件       5814  2006-02-16 20:31  PhotoSprite\Widget\layer.resx

     文件       3653  2006-03-30 13:47  PhotoSprite\Tool\BrushTool.cs

     文件       2534  2006-03-30 14:07  PhotoSprite\Tool\ColorPickerTool.cs

     文件       2542  2006-03-30 00:06  PhotoSprite\Tool\EllipseSelectTool.cs

     文件       2804  2006-03-30 03:35  PhotoSprite\Tool\EraserTool.cs

     文件       2853  2006-03-30 00:06  PhotoSprite\Tool\LassoSelectTool.cs

     文件       3907  2006-03-30 14:41  PhotoSprite\Tool\LineTool.cs

     文件       6893  2006-03-30 14:09  PhotoSprite\Tool\PaintBucketTool.cs

............此处省略150个文件信息

评论

共有 条评论

相关资源