zoukankan      html  css  js  c++  java
  • 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();
    
              
            }
        }
    }
  • 相关阅读:
    initData()
    moveUp()
    moveLeft()
    moveDown()
    函数具体分析
    Linux命令学习笔记
    RocketMQ使用记录
    solr安装记录
    centos7下面ruby的升级
    centos7下面装fastdfs
  • 原文地址:https://www.cnblogs.com/gisoracle/p/8721427.html
Copyright © 2011-2022 走看看