码迷,mamicode.com
首页 > 其他好文 > 详细

瑕疵的数位相框

时间:2019-09-13 14:00:41      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:from   send   inter   filename   strip   obj   --   his   http   

按照书上的方式修改成自己想要的数位相框,有很多瑕疵不知道怎么修改,希望有人能帮助解答^^


1.相片读入会变色、扭曲--我比较希望读入原始相片,我使用ImageList,最大只能256 x 256

2.加入相片,不能按CTRL多选,只能一张一张加,这个不知道怎么办...

我相信,还有很多很多的瑕疵,但是以上两个最严重

文件在此:http://rapidshare.com/files/373468807/photo.beta.exe

程序如下:

一、FORM 1

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;

namespace WindowsFormsApplication5
{
??? public partial class Form1 : Form
??? {
??????? string s;
??????? int c1, c2, c3, i, x = 0;
??????? double b;
??????? public Form1()
??????? {
??????????? InitializeComponent();
??????? }

??????? private void Form1_Load(object sender, EventArgs e)
??????? {

??????? }

??????? private void timer1_Tick(object sender, EventArgs e)
??????? {
??????????? if (i < imageList1.Images.Count)
??????????? {
??????????????? pictureBox1.Image = imageList1.Images[i];
??????????????? i++;
??????????? }
??????????? else i = 0;
??????? }

??????? private void 新建ToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? timer2.Enabled = false;
??????????? imageList1.Images.Clear();
??????????? pictureBox1.Image = null;
??????????? timer1.Enabled = false;

??????? }

??????? private void 加入ToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? openFileDialog1.Filter = "JPG(.JPG)|*.JPG|BMP(.BMP)|*.BMP";
??????????? if (openFileDialog1.ShowDialog() == DialogResult.OK)
??????????? {
??????????????? s = openFileDialog1.FileName;
??????????????? imageList1.Images.Add(Image.FromFile(s));
??????????????? timer1.Enabled = true;
??????????? }

?
??????? }

??????? private void 离开ToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? Application.Exit();
??????? }

??????? private void 背景ToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? colorDialog1.FullOpen = true;
??????????? colorDialog1.Color = this.BackColor;
??????????? if (colorDialog1.ShowDialog() == DialogResult.OK)
??????????? {
??????????????? timer2.Enabled = false;
??????????????? this.BackColor = colorDialog1.Color;
??????????? }
??????? }

??????? private void timer2_Tick(object sender, EventArgs e)
??????? {
??????????? Random abc = new Random();
??????????? c1 = abc.Next(0, 255);
??????????? c2 = abc.Next(0, 255);
??????????? c3 = abc.Next(0, 255);
??????????? this.BackColor = Color.FromArgb(c1, c2, c3);
??????? }

??????? private void 速度ToolStripMenuItem_Click(object sender, EventArgs e)
??????? {
??????????? Form2 obj = new Form2();
??????????? obj.Show(this);
??????????? b = Convert.ToDouble(timer1.Interval);
??????????? obj.updates (b);
??????? }

??????? public void updateb(double value)
??????? {
??????????? this.b = value;
??????????? x = Convert.ToInt32(b * 1000);
??????????? timer1.Interval = x;
??????? }

??????????????
??? }
}

二、FORM 2

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;

namespace WindowsFormsApplication5
{
??? public partial class Form2 : Form
??? {
??????? double a;
???????
??????? public Form2()
??????? {
??????????? InitializeComponent();
??????? }

??????? private void Form2_Load(object sender, EventArgs e)
??????? {

??????? }

??????? private void button1_Click(object sender, EventArgs e)
??????? {
??????????? Form1 owner = (Form1)this.Owner;
??????????? try
??????????? {
??????????????? a = double.Parse(textBox1.Text);
??????????????? owner.updateb(a);
??????????????? this.Close();
??????????? }
??????????? catch (Exception ex)
??????????? {
??????????????? MessageBox.Show("请输入数字");
??????????? }
??????? }
??????????? public void updates(double value)
??????????? {
??????????????? this.a=value;
??????????????? a=a/1000;
??????????????? textBox1.Text=a.ToString();
??????????? }

??????? private void button2_Click(object sender, EventArgs e)
??????? {
??????????? this.Close();???????
??????? }
??? }
}

原文:大专栏  瑕疵的数位相框


瑕疵的数位相框

标签:from   send   inter   filename   strip   obj   --   his   http   

原文地址:https://www.cnblogs.com/petewell/p/11516433.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!