/**
* Limits of image size options interface.
*/publicinterfaceIMaxSizeOptions{/**
* Max width of an output image in pixels.
*/intgetMaxWidth();/**
* Max width of an output image in pixels.
*/intsetMaxWidth();/**
* Max height of an output image in pixels.
*/intgetMaxHeight();/**
* Max height of an output image in pixels.
*/intsetMaxHeight();}
Warning
If you call the setImageWidth/setImageHeight options, calls of the setImageMaxWidth/setImageMaxHeight methods are ignored.
To set the ImageMaxWidth/ImageMaxHeight options, follow these steps:
The following code snippet shows how to set the output image size limits:
importcom.groupdocs.viewer.Viewer;importcom.groupdocs.viewer.options.JpgViewOptions;// ...
try(Viewerviewer=newViewer("sample.jpg")){JpgViewOptionsviewOptions=newJpgViewOptions("result_{0}.jpg");// PngViewOptions viewOptions = new PngViewOptions("result_{0}.png");
// Specify the maximum width and height.
viewOptions.setMaxWidth(800);viewOptions.setMaxHeight(600);viewer.view(viewOptions);}
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.