代码:

//图片大小限制---------------------------
                    System.Drawing.Image txtStoryimage = System.Drawing.Image.FromStream(txtStoryImg.PostedFile.InputStream);
                    if (txtStoryimage.Width > 360 * (1 + ConfigHelper.PicRandValue) || txtStoryimage.Width < 360 * (1 - ConfigHelper.PicRandValue))
                    {
                        Alert.ShowInParent("图片高度应该在" + 360 * (1 - ConfigHelper.PicRandValue) + "-" + 360 * (1 + ConfigHelper.PicRandValue) + "象素之间!");
                        return;

                    }
                    if (txtStoryimage.Height > 452 * (1 + ConfigHelper.PicRandValue) || txtStoryimage.Height < 452 * (1 - ConfigHelper.PicRandValue))
                    {
                        Alert.ShowInParent("图片高度应该在" + 452 * (1 - ConfigHelper.PicRandValue) + "-" + 452 * (1 + ConfigHelper.PicRandValue) + "象素之间!");
                        return;
                    }

  

相关文章:

  • 2021-11-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-14
  • 2022-12-23
  • 2022-02-22
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-02
  • 2021-08-29
相关资源
相似解决方案