image Scaling of picture box

前端 未结 1 1892
我在风中等你
我在风中等你 2021-02-01 03:22

i got a problem with image scaling in C#.

I have a picture Box with given Size : e.g. width = 800px height = 600px

I am loading different images into that pictur

相关标签:
1条回答
  • 2021-02-01 04:15
    this.PictureBox1.SizeMode = PictureBoxSizeMode.Zoom;
    

    Set that property to your PictureBox and the size of the image will increased or decreased to fit the PictureBox maintaining the size ratio.

    For more info: http://msdn.microsoft.com/en-us/library/system.windows.forms.picturebox.sizemode.aspx

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