资源简介
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 WindowsFormsApplication1\bin\Debug\ccc1.jgp
文件 64343 2013-07-03 22:26 WindowsFormsApplication1\bin\Debug\ccc1.jpg
文件 148480 2013-07-08 10:58 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
文件 83456 2013-07-08 10:58 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
文件 11600 2013-07-08 10:38 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
文件 490 2010-03-17 22:39 WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
文件 64343 2013-07-03 22:22 WindowsFormsApplication1\ccc.jpg
文件 8495 2013-07-06 16:54 WindowsFormsApplication1\Form1.cs
文件 7397 2013-07-06 11:58 WindowsFormsApplication1\Form1.Designer.cs
文件 6219 2013-07-06 11:58 WindowsFormsApplication1\Form1.resx
文件 3189 2013-07-04 14:38 WindowsFormsApplication1\Form2.cs
文件 3638 2013-07-04 12:57 WindowsFormsApplication1\Form2.Designer.cs
文件 6219 2013-07-04 12:57 WindowsFormsApplication1\Form2.resx
文件 9964 2013-07-08 10:58 WindowsFormsApplication1\Form3.cs
文件 11459 2013-07-05 13:27 WindowsFormsApplication1\Form3.Designer.cs
文件 11417 2013-07-05 13:27 WindowsFormsApplication1\Form3.resx
文件 958 2013-07-05 17:00 WindowsFormsApplication1\Form4.cs
文件 3468 2013-07-05 17:00 WindowsFormsApplication1\Form4.Designer.cs
文件 5817 2013-07-05 17:00 WindowsFormsApplication1\Form4.resx
文件 374 2013-07-08 10:54 WindowsFormsApplication1\Form5.cs
文件 1184 2013-07-08 10:54 WindowsFormsApplication1\Form5.Designer.cs
文件 6260 2013-07-08 10:58 WindowsFormsApplication1\Form多个图片显示.csproj
文件 1029 2013-07-05 17:28 WindowsFormsApplication1\GDI32.cs
文件 228698 2013-07-05 13:43 WindowsFormsApplication1\images\200d14a4.png
文件 2970 2013-07-05 14:12 WindowsFormsApplication1\images\2c52b6ef.png
文件 228698 2013-07-05 12:38 WindowsFormsApplication1\images\63e9785f.png
文件 2970 2013-07-05 13:47 WindowsFormsApplication1\images\84c5ac8a.png
文件 2970 2013-07-05 13:48 WindowsFormsApplication1\images\860f984b.png
文件 393229 2013-07-05 12:36 WindowsFormsApplication1\images\86f63227.png
文件 3466 2013-07-04 16:16 WindowsFormsApplication1\images\b.png
............此处省略62个文件信息
评论
共有 条评论