winfrom画板功能


winfrom的一个简单的画板功能,imagelist 转换为小图标,在listview里面显示小图标,点击小图标。弹出画板,在点击的图片里面编辑,可以画线。写文字,改变线颜色,字体颜色。插小红旗标注,保存
资源截图
代码片段和文件信息
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.Runtime.InteropServices;
using System.Drawing.Drawing2D;
using System.IO;
//该源码下载自C#编程网|www.cpbcw.com
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
    [System.Runtime.InteropServices.DllImport(“user32.dll“CharSet = System.Runtime.InteropServices.CharSet.Auto)]
    public   static   extern   IntPtr   SendMessage(IntPtr   hWnd   int   msg   int   wParam   int   lParam);
    private   int   LVM_SETICONSPACING   =   0x1035;
    //把下面放到相应 form 的 form_Load 或者是 构造函数中

    [DllImport(“user32.dll“)]
    public static extern IntPtr LoadCursorFromFile(string fileName);
    [DllImport(“user32.dll“)]
    public static extern IntPtr SetCursor(IntPtr cursorHandle);
    [DllImport(“user32.dll“)]
    public static extern uint DestroyCursor(IntPtr cursorHandle);
    private string strLabel1 = ““;

    public string StrLabel1
    {
        get
        {
            return strLabel1;
        }
        set
        {
            strLabel1 = value;
            this.label1.Text = strLabel1;
        }
    }
    public int seleindex;
    private string[] files;

    public string[] Files
    {
        get { return files; }
        set { files = value; }
    }

        private string[] jieguo;
private void button1_Click(object sender EventArgs e)
{

this.openFileDialog1.Multiselect = true;
            //this.openFileDialog1.Filter = “图像文件(*.jpg)|*.jpg“;
if (this.openFileDialog1.ShowDialog() != DialogResult.OK) return;
if (openFileDialog1.SafeFileNames.Length <= 0) return;
            if (this.files != null)
            {
               
                for (int i = 0; i < this.openFileDialog1.FileNames.Length; i++)
                {
                    jieguo=  ArrayResize(this.files this.openFileDialog1.FileNames[i]);

                }
                this.files = jieguo;
            }
            else
            {
                this.files = this.openFileDialog1.FileNames;
            }

for (int i = 0; i < files.Length; i++)
{
this.imageList1.Images.Add(Image.FromFile(this.files[i]));

                    this.listView1.Items.Add(this.files[i].Substring(this.files[i].LastIndexOf(@““) + 1) i);
                   
}
                ArrayImage(files);
}

        /// 
        /// 对数组进行重建并添加新值
        /// 

        /// 原数组(string[])
        /// 要添加的值
        /// 新数组(string[])
        public static string[] ArrayResize(string[] OldArray string NewValue)
        {
            if (NewValue != ““)
            {
                Array.Resize(ref OldArray OldArray.

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

     文件      39521  2013-07-03 22:23  WindowsFormsApplication1inDebugccc1.jgp

     文件      64343  2013-07-03 22:26  WindowsFormsApplication1inDebugccc1.jpg

     文件     148480  2013-07-08 10:58  WindowsFormsApplication1inDebugWindowsFormsApplication1.exe

     文件      83456  2013-07-08 10:58  WindowsFormsApplication1inDebugWindowsFormsApplication1.pdb

     文件      11600  2013-07-08 10:38  WindowsFormsApplication1inDebugWindowsFormsApplication1.vshost.exe

     文件        490  2010-03-17 22:39  WindowsFormsApplication1inDebugWindowsFormsApplication1.vshost.exe.manifest

     文件      64343  2013-07-03 22:22  WindowsFormsApplication1ccc.jpg

     文件       8495  2013-07-06 16:54  WindowsFormsApplication1Form1.cs

     文件       7397  2013-07-06 11:58  WindowsFormsApplication1Form1.Designer.cs

     文件       6219  2013-07-06 11:58  WindowsFormsApplication1Form1.resx

     文件       3189  2013-07-04 14:38  WindowsFormsApplication1Form2.cs

     文件       3638  2013-07-04 12:57  WindowsFormsApplication1Form2.Designer.cs

     文件       6219  2013-07-04 12:57  WindowsFormsApplication1Form2.resx

     文件       9964  2013-07-08 10:58  WindowsFormsApplication1Form3.cs

     文件      11459  2013-07-05 13:27  WindowsFormsApplication1Form3.Designer.cs

     文件      11417  2013-07-05 13:27  WindowsFormsApplication1Form3.resx

     文件        958  2013-07-05 17:00  WindowsFormsApplication1Form4.cs

     文件       3468  2013-07-05 17:00  WindowsFormsApplication1Form4.Designer.cs

     文件       5817  2013-07-05 17:00  WindowsFormsApplication1Form4.resx

     文件        374  2013-07-08 10:54  WindowsFormsApplication1Form5.cs

     文件       1184  2013-07-08 10:54  WindowsFormsApplication1Form5.Designer.cs

     文件       6260  2013-07-08 10:58  WindowsFormsApplication1Form多个图片显示.csproj

     文件       1029  2013-07-05 17:28  WindowsFormsApplication1GDI32.cs

     文件     228698  2013-07-05 13:43  WindowsFormsApplication1images200d14a4.png

     文件       2970  2013-07-05 14:12  WindowsFormsApplication1images2c52b6ef.png

     文件     228698  2013-07-05 12:38  WindowsFormsApplication1images63e9785f.png

     文件       2970  2013-07-05 13:47  WindowsFormsApplication1images84c5ac8a.png

     文件       2970  2013-07-05 13:48  WindowsFormsApplication1images860f984b.png

     文件     393229  2013-07-05 12:36  WindowsFormsApplication1images86f63227.png

     文件       3466  2013-07-04 16:16  WindowsFormsApplication1images.png

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

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)