0
因此,我在这里要做的是导入一个大尺寸的.JPG图像列表,我想将它们缩小而没有太多的质量损失,然后将它们输出为.JPG/.PNG以避免像.BMP那样占用太多内存。从一个目录缩小.JPG图像并保存为另一个.JPG/.PNG
我知道你只能在处理.bmp的时候处理图像。 下面是一些示例代码的我已(我只知道如何导入它们)
private void LoadImages()
{
for (int i = 0; i < trees.Length; i++)
{
string d = imagePath + trees[i].latinName + ".JPG";
treesImage[i] = Image.FromFile(d);
}
//the image path is a constant
//trees[i].latinName is a string property
//treesImage is an array of Images created.
//so I'd like(preferably within my for loop to create the .bmp's and scale down
//using a const value such as const int width = 400, const int height = 300;
//and I'd lke to save the image to a different diretory than imagePath
}
如果有其他任何你想知道的后下方,我将修改的问题