开发工具:
文件大小: 44mb
下载次数: 0
上传时间: 2013-12-07
详细说明: 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.IO; namespace 图片查看器 { public partial class Formmain : Form { bool isLoad = false; FileInfo[] images=null ; //FormRename renameForm = null; int index = -1; public Formmain() { InitializeComponent(); } public void GetFileInder() { DirectoryInfo dir = new Directory Info(folderBrowserDialg1.SelectedPath); images = dir.GetFiles("*.jpg"); } private void btnload_Click(object sender, EventArgs e) { if (folderBrowserDialg1.ShowDialog() == DialogResult.OK) { GetFileInder(); if (images != null && images.Length > 0) { index = 0; picimage.Load(images[index].FullName); picimage.ImageLocation = images[index].FullName; isLoad = true; } else { if (picimage.Image != null) { picimage.Image = null; isLoad = false; } } } } private void btndelete_Click(object sender, EventArgs e) { FileInfo file = null; if (picimage .Image != null) { file = new FileInfo( picimage . ImageLocation.ToString()); file.Delete(); //代码实现 if (!file . Exists) { picimage.Load(images[index+1].FullName); } } } private void btnright_Click(object sender, EventArgs e) { if (index == images.Length - 1) { index = 0; } else { index += 1; } picimage.Load(images[index].FullName); picimage.ImageLocation = images[index].FullName; } private void btnleft_Click_1(object sender, EventArgs e) { if (index == 0) { index = images.Length - 1; } else { index -= 1; } picimage.Load(images[index].FullName); picimage.ImageLocation = images[index].FullName; } private void timer_Tick(object sender, EventArgs e) { if (isLoad) { if (index == images.Length - 1) { index = 0; } else { index += 1; } picimage.Load(images[index].FullName); picimage.ImageLocation = images[index].FullName; } } private void btnouter_Click(object sender, EventArgs e) { timer.Enabled = !timer.Enabled; } private void btnname_Click(object sender, EventArgs e) { if (picimage.Image != null) { FormRename renameForm = new FormRename(); renameForm.Images = images; renameForm.Current = index; renameForm.ShowDialog(); } } } } ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.