-
public final class BitmapDraw
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classBitmapDraw.Companion
-
Field Summary
Fields Modifier and Type Field Description private final Bitmapbitmapprivate final PrinterOptionsoptions
-
Constructor Summary
Constructors Constructor Description BitmapDraw(Context context, PrinterOptions options)
-
Method Summary
Modifier and Type Method Description final BitmapgetBitmap()final PrinterOptionsgetOptions()final UnitaddText(String text, Float textSize, Boolean bold, Paint.Align align, @IntRange(from = 0.toLong(), to = 100.toLong()) Integer widthPercent)Draw text final UnitaddImage(Bitmap image, Paint.Align align, @IntRange(from = 0.toLong(), to = 100.toLong()) Integer widthPercent)Draw image bitmap final Unitnewline()Move start position to next line final UnitfeedPaper(Float height)Feed the paper -
-
Constructor Detail
-
BitmapDraw
BitmapDraw(Context context, PrinterOptions options)
-
-
Method Detail
-
getOptions
final PrinterOptions getOptions()
-
addText
final Unit addText(String text, Float textSize, Boolean bold, Paint.Align align, @IntRange(from = 0.toLong(), to = 100.toLong()) Integer widthPercent)
Draw text
- Parameters:
text- the text to be drawnbold- true to set the text to bold, false to normal.align- set the ratio of text width to paperwidthPercent- set the ratio of text width to paper,from 0-100, 0 to automatically adapt the occupied width according to the text width.
-
addImage
final Unit addImage(Bitmap image, Paint.Align align, @IntRange(from = 0.toLong(), to = 100.toLong()) Integer widthPercent)
Draw image bitmap
- Parameters:
image- the image to be drawnalign- set the ratio of text width to paperwidthPercent- set the ratio of image width to paper,from 0-100, 0 to automatically adapt the occupied width according to the image width.
-
-
-
-