- if (isresize)
- {
- imgWidth = getWidth();
- imgHeight = getHeight();
-
- imgWidth -= (imgWidth % charWidth);
- imgHeight -= (imgHeight % charHeight);
-
- if ((imgWidth > 0) && (imgHeight > 0))
- {
- BufferedImage newimg = new BufferedImage(imgWidth, imgHeight,
- BufferedImage.TYPE_INT_ARGB);
-
- gg = (Graphics2D) newimg.getGraphics();
- gg.setFont(av.getFont());
- gg.drawImage(img, null, 0, 0);
- img = newimg;
+ gg.copyArea(horizontal * charWidth, vertical * charHeight, imgWidth,
+ imgHeight, -horizontal * charWidth, -vertical * charHeight);