我有以下代码,其中我没有理解:
double savesize = (8.0 * ((height * (width / 3) * 3) / 3 - 1)) / 1024;
所以请帮助我。
代码:
private void ImageBrowseButton_Click(object sender, EventArgs e)
{
DialogResult dr = openFileDialog1.ShowDialog();
if (dr == DialogResult.OK)
{
loadedImagePath = openFileDialog1.FileName;
imageTextBox.Text= loadedImagePath;
loadedImage = Image.FromFile(loadedImagePath);
height = loadedImage.Height;
width = loadedImage.Width;
loadedBitmap = new Bitmap(loadedImage);
FileInfo imginf = new FileInfo(loadedImagePath);
float size = (float)imginf.Length / 1024;
SizeLabel.Text = size.ToString() + " KB";
HeightLabel.Text = loadedImage.Height.ToString() + " Pixel";
WidthLabel.Text = loadedImage.Width.ToString() + " Pixel";
double savesize = (8.0 * ((height * (width / 3) * 3) / 3 - 1)) / 1024;
SaveSizeLabel.Text = savesize.ToString() + " KB";
}
}
谢谢