Вы разрабатываете приложение, в котором будет использоваться печать изображений. Для формирования области печати вы определили некоторые параметры: //Размер изображенияfloat ILength;float LMargin = e.MarginBounds.Left;float RMargin = e.MarginBounds.Right;float TMargin = e.MarginBounds.Top;float BMargin= e.MarginBounds.Bottom;float printableWidth = e.MarginBounds.Width;float printableHeight = e.MarginBounds.Height;
Параметры страницы могут меняться, и поэтому, чтобы избежать обрезки изображения, требуется корректировать его размер – наибольшая сторона изображения должна составляет 75% от кратчайшей стороны листа. Выберите правильный фрагмент кода для этого:
(Отметьте один правильный вариант ответа.)
Варианты ответа
double XP = LMargin;double YP = TMargin;if (printableWidth < printableHeight){ imageLength = Convert.ToDouble(printableWidth * 0.75); Yposition = imageLength;}else{ imageLength = Convert.ToDouble(printableHeight * 0.75); Xposition = imageLength + spaceWidth;}
float XP = LMargin;float YP = TMargin;if (printableWidth < printableHeight){ imageLength = Convert.ToDouble(printableWidth * 0.75); Yposition += imageLength;}else{ imageLength = Convert.ToDouble(printableHeight * 0.75); Xposition += imageLength + spaceWidth;}
float XP = LMargin;float YP = TMargin;if (printableWidth < printableHeight){ imageLength = printableWidth * 0.75f; Yposition += imageLength;}else{ imageLength = printableHeight * 0.75f; Xposition += imageLength + spaceWidth;}(Верный ответ)
float XP = LMargin;float YP = TMargin;if (printableWidth < printableHeight){ imageLength = printableWidth * 0,75f; Yposition += imageLength;}else{ imageLength = printableHeight * 0,75f; Xposition += imageLength + spaceWidth;}
float XP = LMargin;float YP = TMargin;if (printableWidth < printableHeight){ imageLength = Convert.ToDouble(printableWidth * 0.75); Yposition = imageLength;}else{ imageLength = Convert.ToDouble(printableHeight * 0.75); Xposition = imageLength + spaceWidth;}