How to put image in a picture box from Bitmap

后端 未结 3 1494
攒了一身酷
攒了一身酷 2021-02-18 13:09

Is it possible to load a picture from memory (byte[] or stream or Bitmap) without saving it to disk?

This is the code I use to tur

3条回答
  •  春和景丽
    2021-02-18 13:51

    If you are working with C++ programming language, it can be done like this:

    void backGroundImage()
    {
        Image^ back = gcnew Bitmap("C:\\Users\\User\\Documents\\image.bmp");
        pictureBox1->BackGroundImage = back;
    };
    

    Then you can call backGroundImage when you need to load a bitmap.

提交回复
热议问题