Package totalcross.io.device.printer
Class MonoImage
- java.lang.Object
-
- totalcross.ui.gfx.GfxSurface
-
- totalcross.ui.image.Image
-
- totalcross.io.device.printer.MonoImage
-
public class MonoImage extends Image
Image class that can be used to save 1-bpp images and print on monochromatic printers. Only black pixels are printed, non-black are ignored.
-
-
Field Summary
Fields Modifier and Type Field Description booleandoClipIf set to true, the image's width is limited to 384 (double density) or 192 (single density).-
Fields inherited from class totalcross.ui.image.Image
alphaMask, comment, FADE_VALUE, height, hwScaleH, hwScaleW, NO_TRANSPARENT_COLOR, surfaceType, transparentColor, useAlpha, width
-
-
Constructor Summary
Constructors Constructor Description MonoImage(byte[] fullDescription)Creates a MonoImage based on the given full description.MonoImage(int width, int height)Creates a MonoImage with the given width and height.MonoImage(java.lang.String path)Creates a MonoImage, loading the given bmp file.MonoImage(Stream s)Creates a MonoImage read from the given Stream.MonoImage(Image other)Makes a copy of the given image.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidprintTo(BluetoothPrinter pad)Prints a 1-bpp bitmap from this image.-
Methods inherited from class totalcross.ui.image.Image
applyChanges, applyColor, applyColor2, applyFade, changeColors, createJpg, createJpg4B, createPng, equals, freeTexture, getAlphaInstance, getClippedInstance, getCopy, getCurrentFrame, getFadedInstance, getFadedInstance, getFrameCount, getFrameInstance, getGraphics, getHeight, getHwScaledInstance, getJpegBestFit, getJpegScaled, getPath, getPixelRow, getPixels, getRotatedScaledInstance, getScaledInstance, getSmoothScaledInstance, getSmoothScaledInstance, getTouchedUpInstance, getWidth, getX, getY, hashCode, hwScaledBy, hwScaledFixedAspectRatio, isSupported, loadFrom, lockChanges, nextFrame, prevFrame, resizeJpeg, saveTo, scaledBy, setCurrentFrame, setFrameCount, setHwScaleFixedAspectRatio, setTransparentColor, smoothScaledBy, smoothScaledBy, smoothScaledFixedAspectRatio, smoothScaledFixedAspectRatio, smoothScaledFromResolution, smoothScaledFromResolution, writeFrameCount
-
-
-
-
Constructor Detail
-
MonoImage
public MonoImage(Image other) throws ImageException
Makes a copy of the given image.- Throws:
ImageException
-
MonoImage
public MonoImage(Stream s) throws ImageException, IOException
Creates a MonoImage read from the given Stream.- Throws:
ImageExceptionIOException
-
MonoImage
public MonoImage(byte[] fullDescription) throws ImageExceptionCreates a MonoImage based on the given full description.- Throws:
ImageException
-
MonoImage
public MonoImage(int width, int height) throws ImageExceptionCreates a MonoImage with the given width and height. You can draw into it by retrieving the Graphics using img.getGraphics().- Throws:
ImageException
-
MonoImage
public MonoImage(java.lang.String path) throws ImageException, IOExceptionCreates a MonoImage, loading the given bmp file.- Throws:
ImageExceptionIOException
-
-
Method Detail
-
printTo
protected void printTo(BluetoothPrinter pad) throws IOException
Prints a 1-bpp bitmap from this image. When writting, all non-white pixels are written.- Throws:
IOException
-
-