1 vb.net
我正在使用下面的代码读取图像(jpg),我需要检查图像是否大于150像素×150像素且小于25k,我应该怎么做?
PictureBox2.Image = Image.FromFile(.FileName)
Run Code Online (Sandbox Code Playgroud)
If New FileInfo(.FileName).Length > 25 * 1024 Then ... 'More than 25KB'
Dim img = Image.FromFile(.FileName)
If img.Size.Width > 150 OrElse img.Size.Height > 150 Then ... 'More than 150x150'
Picturebox1.Image = img
Run Code Online (Sandbox Code Playgroud)