开发者

Load thumbnail image into PictureBox from directory

开发者 https://www.devze.com 2023-01-01 07:29 出处:网络
I use the following code to get thumbnail of image in Resources, and display on Picturebox. Image tmp = (System.Drawing.Im开发者_运维百科age)myManager.GetObject(tempImage);

I use the following code to get thumbnail of image in Resources, and display on Picturebox.

Image tmp = (System.Drawing.Im开发者_运维百科age)myManager.GetObject(tempImage);
                cfgPassPicture[m].Image = tmp.GetThumbnailImage(40, 40, new System.Drawing.Image.GetThumbnailImageAbort(ThumbnailCallback), System.IntPtr.Zero);

How do I do this for images in directory (instead of resources), given only the URL? I can load image into PictureBox via ImageLocation property, but not sure how to use Image property of PictureBox for this.

Thanks


  myPictureBox.Image = Image.FromFile("yourimagepath.jpg");
0

精彩评论

暂无评论...
验证码 换一张
取 消