• 大小: 3.15M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2024-06-08
  • 语言: C#
  • 标签: c#  

资源简介


使用C#实现了简单的证件照排版功能,包括分辨率自动设置为300dpi,支持一寸和二寸照片排版在五寸、六寸和七寸相纸上,并支持实时打印,以及保存为jpg等操作,界面友好!

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace My拼接
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }
        
        Bitmap bitmap1;
        private void button1_Click(object sender EventArgs e)
        {
            OpenFileDialog openDG = new OpenFileDialog();
            if (openDG.ShowDialog() == DialogResult.OK)
            {
                pictureBox1.Image = Image.FromFile(openDG.FileName);
            }
            bitmap1 = pictureBox1.Image as Bitmap;

        }

        private void button2_Click(object sender EventArgs e)
        {
            label1.Text = ““;
            Bitmap bmpYS = pictureBox1.Image as Bitmap;
            if (comboBox1.Text==“一寸照片“)
            {

                Bitmap bmpZP = SetSize(bmpYS 750 1050);
                //MessageBox.Show(bmpZP.Width.ToString()+““+bmpZP.Height.ToString());
                pictureBox2.Image = bmpZP;
                if (comboBox2.Text == “五寸相纸“)
                {
                    HeBing(bmpZP 2 2);
                    Bitmap zhengjianzhao1 = pictureBox2.Image as Bitmap;
                    //Bitmap zhengjianzhao2=SetSize(zhengjianzhao17501050);
                    Bitmap xiangzhi = XiangZhi(“五寸相纸“);
                    pictureBox3.Image = TuPianDieJia(zhengjianzhao1 xiangzhi);
                }
                else if (comboBox2.Text == “六寸相纸“)
                {
                    HeBing(bmpZP 2 2);
                    Bitmap zhengjianzhao1 = pictureBox2.Image as Bitmap;
                    //Bitmap zhengjianzhao2=SetSize(zhengjianzhao17501050);
                    Bitmap xiangzhi = XiangZhi(“六寸相纸“);
                    pictureBox3.Image = TuPianDieJia(zhengjianzhao1 xiangzhi);
                }
                else if (comboBox2.Text == “七寸相纸“)
                {
                    HeBing(bmpZP 3 3);
                    Bitmap zhengjianzhao1 = pictureBox2.Image as Bitmap;
                    //Bitmap zhengjianzhao2=SetSize(zhengjianzhao17501050);
                    Bitmap xiangzhi = XiangZhi(“七寸相纸“);
                    pictureBox3.Image = TuPianDieJia(zhengjianzhao1 xiangzhi);
                }
                else
                {
                    MessageBox.Show(“请选择相纸!“);
                }
                pictureBox2.Image = bmpZP;
            }
            else
            {
                Bitmap bmpZP = SetSize(bmpYS 1050 1590);
                pictureBox2.Image = bmpZP;
                if (comboBox2.Text == “五寸相纸“)
                {
                    HeBing(bmpZP 1 1);
                    Bitmap zhengjianzhao1 = pictureBox2.Image as Bitmap;
                    //Bitmap zhengji

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-21 15:41  证件照排版器\
     目录           0  2017-10-09 10:46  证件照排版器\.vs\
     目录           0  2017-10-09 10:46  证件照排版器\.vs\My拼接\
     目录           0  2017-10-09 10:46  证件照排版器\.vs\My拼接\v14\
     文件       49152  2017-09-29 13:07  证件照排版器\.vs\My拼接\v14\.suo
     目录           0  2017-12-21 15:40  证件照排版器\My拼接\
     文件         189  2017-09-27 18:39  证件照排版器\My拼接\App.config
     目录           0  2017-12-21 15:36  证件照排版器\My拼接\bin\
     目录           0  2017-12-21 15:36  证件照排版器\My拼接\bin\Debug\
     文件     5631120  2017-12-20 16:18  证件照排版器\My拼接\bin\Debug\mscorlib.dll
     文件       17920  2017-12-21 15:39  证件照排版器\My拼接\bin\Debug\My拼接.exe
     文件         189  2017-09-27 18:39  证件照排版器\My拼接\bin\Debug\My拼接.exe.config
     文件       46592  2017-12-21 15:39  证件照排版器\My拼接\bin\Debug\My拼接.pdb
     文件       22984  2017-12-21 15:41  证件照排版器\My拼接\bin\Debug\My拼接.vshost.exe
     文件         189  2017-09-27 18:39  证件照排版器\My拼接\bin\Debug\My拼接.vshost.exe.config
     文件       59342  2013-06-18 20:28  证件照排版器\My拼接\bin\Debug\normidna.nlp
     文件       47076  2013-06-18 20:28  证件照排版器\My拼接\bin\Debug\normnfc.nlp
     文件       40566  2013-06-18 20:28  证件照排版器\My拼接\bin\Debug\normnfd.nlp
     文件       67808  2013-06-18 20:28  证件照排版器\My拼接\bin\Debug\normnfkc.nlp
     文件       61718  2013-06-18 20:28  证件照排版器\My拼接\bin\Debug\normnfkd.nlp
     文件      180832  2012-07-10 21:52  证件照排版器\My拼接\bin\Debug\System.Net.Http.dll
     文件      201824  2012-06-23 01:00  证件照排版器\My拼接\bin\Debug\System.Net.Http.xml
     目录           0  2017-12-21 15:34  证件照排版器\My拼接\bin\Debug\zh-Hans\
     文件     1014456  2017-12-20 16:21  证件照排版器\My拼接\bin\Debug\zh-Hans\mscorlib.resources.dll
     文件       17504  2012-07-10 23:31  证件照排版器\My拼接\bin\Debug\zh-Hans\System.Net.Http.resources.dll
     目录           0  2017-12-21 15:36  证件照排版器\My拼接\bin\Release\
     文件       12394  2017-12-21 15:39  证件照排版器\My拼接\MainForm.cs
     文件       13369  2017-12-21 15:39  证件照排版器\My拼接\MainForm.Designer.cs
     文件        6192  2017-12-21 15:39  证件照排版器\My拼接\MainForm.resx
     目录           0  2017-10-09 10:46  证件照排版器\My拼接\obj\
     目录           0  2017-12-21 15:41  证件照排版器\My拼接\obj\Debug\
............此处省略25个文件信息

评论

共有 条评论