• C# 其他图片格式转emf


    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.Drawing.Imaging;
    
    
    namespace pngtoemf
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void Save()
            {
                string filePath = @"D:闫磊.emf";
    
                Bitmap bmp = new Bitmap(pictureBox1.Width, pictureBox1.Height);
                Graphics gs = Graphics.FromImage(bmp);
                Metafile mf = new Metafile(filePath, gs.GetHdc());
    
                Graphics g = Graphics.FromImage(mf);
    
                //g.FillEllipse(Brushes.Gray, 0, 0, 100, 100);
                //g.DrawEllipse(Pens.Black, 0, 0, 100, 100);
                //g.DrawArc(new Pen(Color.Red, 10), 20, 20, 60, 60, 30, 120);
                g.DrawImage(pictureBox1.Image, 0, 0);
                g.Save();
                g.Dispose();
                mf.Dispose();
            }
            private void button1_Click(object sender, EventArgs e)
            {
                pictureBox1.Load(this.textBox1.Text);
                Save();
    
              
            }
        }
    }
  • 相关阅读:
    pat 1034 Head of a Gang (30分)
    pta坑点
    Devc++ 编译 c++11
    Invitation Cards dijkstra法
    Cube Stacking
    畅通工程
    蚂蚁上树
    洛谷 P1439 【模板】最长公共子序列
    Recursive sequence
    A Simple Math Problem
  • 原文地址:https://www.cnblogs.com/gisoracle/p/8721427.html
Copyright © 2020-2023  润新知