zoukankan      html  css  js  c++  java
  • 如何将gridview保存为图片

    如何将gridview保存为图片

    1

    2

    3

    4

    5

    6

    7

    8

    9

    10

    11

    12

    13

    14

    15

    16

    17

    18

    19

    private void button1_Click(object sender, EventArgs e)

            {

                // Create a bitmap for save

                Bitmap bmp = new Bitmap(dataGridView1.Width,

                                        dataGridView1.Width,

                                        PixelFormat.Format32bppPArgb);

                // Create a graphic for drawing from bmp

                Point point = new Point(dataGridView1.Left,

                                       dataGridView1.Top);

                Graphics screenG = Graphics.FromImage(bmp);

                screenG.CopyFromScreen(PointToScreen(point),

                                       new Point(0, 0),

                                       dataGridView1.Size,

                                       CopyPixelOperation.SourceCopy);

                bmp.Save("abc.bmp"); // save the screenshot

                 

            }

  • 相关阅读:
    标签平滑Label Smoothing
    py 中传参时**符号学习
    RoBERTa模型学习
    获取bert所有隐层的输出
    json.dumps||ensure_ascii
    nn.LSTM输入、输出、参数及pad
    py中的heapq操作
    fastnlp中的CRF补齐的padding?
    P3393 逃离僵尸岛 最短路dijkstra
    P2057 [SHOI2007]善意的投票 最小割
  • 原文地址:https://www.cnblogs.com/grj001/p/12223348.html
Copyright © 2011-2022 走看看