/// <summary>/// Limits of image size options interface. /// </summary>publicinterfaceIMaxSizeOptions{/// <summary>/// Max width of an output image in pixels./// </summary>intMaxWidth{get;set;}/// <summary>/// Max height of an output image in pixels./// </summary>intMaxHeight{get;set;}}
''' <summary>
''' Limits of image size options interface.
''' </summary>
PublicInterfaceIMaxSizeOptions''' <summary>
''' Max width of an output image in pixels.
''' </summary>
PropertyMaxWidthAsInteger''' <summary>
''' Max height of an output image in pixels.
''' </summary>
PropertyMaxHeightAsIntegerEndInterface
Warning
If you set the ImageWidth/ImageHeight options, the ImageMaxWidth/ImageMaxHeight options are ignored.
To set the ImageMaxWidth/ImageMaxHeight options, follow these steps:
The following code snippet shows how to set the output image size limits:
usingGroupDocs.Viewer;usingGroupDocs.Viewer.Options;// ...using(Viewerviewer=newViewer("sample.jpg")){// Create a JPG or PNG file.JpgViewOptionsviewOptions=newJpgViewOptions("result_{0}.jpg");// or PngViewOptions viewOptions = new PngViewOptions("result_{0}.png");// Specify the maximum width and height.viewOptions.MaxWidth=800;viewOptions.MaxHeight=600;viewer.View(viewOptions);}
ImportsGroupDocs.ViewerImportsGroupDocs.Viewer.Options' ...
ModuleProgramSubMain(argsAsString())UsingviewerAsViewer=NewViewer("sample.jpg")' Create a JPG or PNG file.
DimviewOptionsAsJpgViewOptions=NewJpgViewOptions("result_{0}.jpg")' or PngViewOptions viewOptions = new PngViewOptions("result_{0}.png");
' Specify the maximum width and height.
viewOptions.MaxWidth=800viewOptions.MaxHeight=600viewer.View(viewOptions)EndUsingEndSubEndModule
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.