PaintContext (Java SE 10 & JDK 10 )
-
public interface PaintContextThe
PaintContextinterface defines the encapsulated and optimized environment to generate color patterns in device space for fill or stroke operations on aGraphics2D. ThePaintContextprovides the necessary colors forGraphics2Doperations in the form of aRasterassociated with aColorModel. ThePaintContextmaintains state for a particular paint operation. In a multi-threaded environment, several contexts can exist simultaneously for a singlePaintobject.- See Also:
Paint
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddispose()Releases the resources allocated for the operation.
ColorModelgetColorModel()Returns the
ColorModelof the output.RastergetRaster(int x, int y, int w, int h)Returns a
Rastercontaining the colors generated for the graphics operation.
-
-
-
Method Detail
-
dispose
void dispose()
Releases the resources allocated for the operation.
-
getColorModel
ColorModel getColorModel()
Returns the
ColorModelof the output. Note that thisColorModelmight be different from the hint specified in thecreateContextmethod ofPaint. Not allPaintContextobjects are capable of generating color patterns in an arbitraryColorModel.- Returns:
- the
ColorModelof the output.
-
getRaster
Raster getRaster(int x, int y, int w, int h)
Returns a
Rastercontaining the colors generated for the graphics operation.- Parameters:
x- the x coordinate of the area in device space for which colors are generated.y- the y coordinate of the area in device space for which colors are generated.w- the width of the area in device spaceh- the height of the area in device space- Returns:
- a
Rasterrepresenting the specified rectangular area and containing the colors generated for the graphics operation.
-
-
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2018, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.