zoukankan      html  css  js  c++  java
  • Winform-图片上传

    1.界面上拖个.pictureBox(pictureBox1)

    //上传点击按钮

    private void button1_Click(object sender, EventArgs e)
    {
    OpenFileDialog fileDialog = new OpenFileDialog();
    DialogResult result = fileDialog.ShowDialog();
    if (result == DialogResult.OK)
    {
    this.pictureBox1.Image = Image.FromFile(fileDialog.FileName);
    }
    }

    //清楚图片按钮

    private void button2_Click(object sender, EventArgs e)
    {
    this.pictureBox1.Image = null;
    }

    C#--程序背景图片设置

    public Form1()
    {
    InitializeComponent();
    this.pictureBox1.BackgroundImage = Image.FromFile(@"C:UsersadminDesktoplogo.png");
    this.BackgroundImageLayout = ImageLayout.Stretch;//自动伸展
    }

  • 相关阅读:
    失格
    救赎
    篝火晚会
    旅行家的预算
    荒诞
    mod
    clique
    序列
    [CF932E]Team Work & [BZOJ5093]图的价值
    NOIWC2018游记
  • 原文地址:https://www.cnblogs.com/macT/p/9288936.html
Copyright © 2011-2022 走看看