|
| 1 | +--- |
| 2 | +title: GraphicsRenderer |
| 3 | +second_title: Aspose.Imaging for Java API Reference |
| 4 | +description: The class handles drawing com.aspose.imaging.Image directly upon the java.awt.Graphic2D. |
| 5 | +type: docs |
| 6 | +weight: 10 |
| 7 | +url: /java/com.aspose.imaging.awt/graphicsrenderer/ |
| 8 | +--- |
| 9 | +**Inheritance:** |
| 10 | +java.lang.Object, [com.aspose.imaging.DisposableObject](../../com.aspose.imaging/disposableobject) |
| 11 | +``` |
| 12 | +public class GraphicsRenderer extends DisposableObject |
| 13 | +``` |
| 14 | + |
| 15 | +The class handles drawing com.aspose.imaging.Image directly upon the java.awt.Graphic2D. Using this class it is possible to avoid multiple allocations and coping the pixels between com.aspose.Imaging buffers into java.awt.BufferImage in case of VectorImage. |
| 16 | +## Constructors |
| 17 | + |
| 18 | +| Constructor | Description | |
| 19 | +| --- | --- | |
| 20 | +| [GraphicsRenderer(Image image)](#GraphicsRenderer-com.aspose.imaging.Image-) | Creates a new render. | |
| 21 | +| [GraphicsRenderer(Image image, ImageOptionsBase exportOptions)](#GraphicsRenderer-com.aspose.imaging.Image-com.aspose.imaging.ImageOptionsBase-) | Creates a new render. | |
| 22 | +| [GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering)](#GraphicsRenderer-com.aspose.imaging.Image-com.aspose.imaging.Color-int-int-) | Creates a new render. | |
| 23 | +## Methods |
| 24 | + |
| 25 | +| Method | Description | |
| 26 | +| --- | --- | |
| 27 | +| [render(Graphics2D graphics)](#render-java.awt.Graphics2D-) | Performs the rendering on the given `graphics` with scale factor 1.0. | |
| 28 | +| [render(Graphics2D graphics, float scaleFactor)](#render-java.awt.Graphics2D-float-) | Performs the rendering on the given `graphics`. | |
| 29 | +### GraphicsRenderer(Image image) {#GraphicsRenderer-com.aspose.imaging.Image-} |
| 30 | +``` |
| 31 | +public GraphicsRenderer(Image image) |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +Creates a new render. By default render will be proceed using the [SmoothingMode.HighQuality](../../com.aspose.imaging/smoothingmode\#HighQuality), [TextRenderingHint.ClearTypeGridFit](../../com.aspose.imaging/textrenderinghint\#ClearTypeGridFit), and with a white background color. |
| 36 | + |
| 37 | +**Parameters:** |
| 38 | +| Parameter | Type | Description | |
| 39 | +| --- | --- | --- | |
| 40 | +| image | [Image](../../com.aspose.imaging/image) | The image which will be rendered on the java.awt.Graphics2D | |
| 41 | + |
| 42 | +### GraphicsRenderer(Image image, ImageOptionsBase exportOptions) {#GraphicsRenderer-com.aspose.imaging.Image-com.aspose.imaging.ImageOptionsBase-} |
| 43 | +``` |
| 44 | +public GraphicsRenderer(Image image, ImageOptionsBase exportOptions) |
| 45 | +``` |
| 46 | + |
| 47 | + |
| 48 | +Creates a new render. |
| 49 | + |
| 50 | +**Parameters:** |
| 51 | +| Parameter | Type | Description | |
| 52 | +| --- | --- | --- | |
| 53 | +| image | [Image](../../com.aspose.imaging/image) | The image which will be rendered on the java.awt.Graphics2D | |
| 54 | +| exportOptions | [ImageOptionsBase](../../com.aspose.imaging/imageoptionsbase) | The export options for adjusting the exporting image. | |
| 55 | + |
| 56 | +### GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering) {#GraphicsRenderer-com.aspose.imaging.Image-com.aspose.imaging.Color-int-int-} |
| 57 | +``` |
| 58 | +public GraphicsRenderer(Image image, Color backgroundColor, int smoothingMode, int textRendering) |
| 59 | +``` |
| 60 | + |
| 61 | + |
| 62 | +Creates a new render. |
| 63 | + |
| 64 | +**Parameters:** |
| 65 | +| Parameter | Type | Description | |
| 66 | +| --- | --- | --- | |
| 67 | +| image | [Image](../../com.aspose.imaging/image) | The image which will be rendered on the java.awt.Graphics2D | |
| 68 | +| backgroundColor | [Color](../../com.aspose.imaging/color) | The background color. | |
| 69 | +| smoothingMode | int | The smoothing mode. | |
| 70 | +| textRendering | int | The text rendering mode. | |
| 71 | + |
| 72 | +### render(Graphics2D graphics) {#render-java.awt.Graphics2D-} |
| 73 | +``` |
| 74 | +public void render(Graphics2D graphics) |
| 75 | +``` |
| 76 | + |
| 77 | + |
| 78 | +Performs the rendering on the given `graphics` with scale factor 1.0. |
| 79 | + |
| 80 | +**Parameters:** |
| 81 | +| Parameter | Type | Description | |
| 82 | +| --- | --- | --- | |
| 83 | +| graphics | java.awt.Graphics2D | The graphics for drawing. | |
| 84 | + |
| 85 | +### render(Graphics2D graphics, float scaleFactor) {#render-java.awt.Graphics2D-float-} |
| 86 | +``` |
| 87 | +public void render(Graphics2D graphics, float scaleFactor) |
| 88 | +``` |
| 89 | + |
| 90 | + |
| 91 | +Performs the rendering on the given `graphics`. |
| 92 | + |
| 93 | +**Parameters:** |
| 94 | +| Parameter | Type | Description | |
| 95 | +| --- | --- | --- | |
| 96 | +| graphics | java.awt.Graphics2D | The graphics for drawing. | |
| 97 | +| scaleFactor | float | The scale factor. | |
| 98 | + |
0 commit comments