Легкая проблема, но по какой-то причине я просто не могу понять это сегодня.
Мне нужно изменить размер изображения до максимально возможного размера, который будет помещаться в ограничительную рамку, сохраняя соотношение сторон.
В основном я ищу код для заполнения этой функции:
void CalcNewDimensions(ref int w, ref int h, int MaxWidth, int MaxHeight);
Где w и h - исходная высота и ширина (в), а новая высота и ширина (out), а MaxWidth и MaxHeight определяют ограничивающий прямоугольник, в который должно быть вложено изображение.