c# 获取图像 宽度 高度 位深度

Image imgPhoto = Image.FromFile(TempPath + obj);
                    float maxsize = imgPhoto.Height * imgPhoto.Width * Image.GetPixelFormatSize(imgPhoto.PixelFormat) / 1024 / 1024; //长(像素) x 宽(像素) x 颜色深度 / 1024 /1024

                    if (maxsize > 4) //图片太大
                    {
                        publicOperation.setShowBoxStyle(SetLanguage.getValues("FileSizeError", "frmPlayList_Message"));
                        return;
                    }

你可能感兴趣的:(C#)