Fit Image into PictureBox

前端 未结 9 726
栀梦
栀梦 2020-12-15 14:43
using (SqlConnection myDatabaseConnection = new SqlConnection(myConnectionString.ConnectionString))
{
    myDatabaseConnection.Open();
    using (SqlCommand SqlComma         


        
相关标签:
9条回答
  • 2020-12-15 15:21

    You can set picturebox's SizeMode property to PictureSizeMode.Zoom, this will increase the size of smaller images or decrease the size of larger images to fill the PictureBox

    0 讨论(0)
  • 2020-12-15 15:29

    Use the following lines of codes and you will find the solution...

    pictureBox1.ImageLocation = @"C:\Users\Desktop\mypicture.jpg";
    pictureBox1.SizeMode =PictureBoxSizeMode.StretchImage;
    
    0 讨论(0)
  • 2020-12-15 15:29

    Imam Mahdi aj

    You can use the properties section

    0 讨论(0)
  • 2020-12-15 15:32

    You could try changing the: SizeMode property of the PictureBox.

    You could also set your image as the BackGroundImage of the PictureBox and try changing the BackGroundImageLayout to the correct mode.

    0 讨论(0)
  • 2020-12-15 15:33

    Have a look at the sizemode property of the picturebox.

    pictureBox1.SizeMode =PictureBoxSizeMode.StretchImage;
    
    0 讨论(0)
  • 2020-12-15 15:35

    You could use the SizeMode property of the PictureBox Control and set it to Center. This will match the center of your image to the center of your picture box.

    pictureBox1.SizeMode = PictureBoxSizeMode.CenterImage;
    

    Hope it could help.

    0 讨论(0)
提交回复
热议问题