Module uk.co.caprica.vlcj
Class ScaledCallbackImagePainter
java.lang.Object
uk.co.caprica.vlcj.player.component.callback.ScaledCallbackImagePainter
- All Implemented Interfaces:
CallbackImagePainter
Implementation of a painter that scales to fit the container while preserving the original aspect ratio.
The default implementation uses bilinear interpolation when painting the scaled image.
The aspect ratio of the original image is preserved when scaling is applied.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidpaint(Graphics2D g2, JComponent component, BufferedImage image) Paint the image.voidprepare(Graphics2D g2, JComponent component) Prepare the drawing context.
-
Constructor Details
-
ScaledCallbackImagePainter
public ScaledCallbackImagePainter()
-
-
Method Details
-
prepare
Description copied from interface:CallbackImagePainterPrepare the drawing context.This is intended to set context attributes like
RenderingHintsbefore painting the image itself.- Specified by:
preparein interfaceCallbackImagePainter- Parameters:
g2- graphics contextcomponent- component to paint
-
paint
Description copied from interface:CallbackImagePainterPaint the image.- Specified by:
paintin interfaceCallbackImagePainter- Parameters:
g2- graphics contextcomponent- component to paintimage- image to paint
-