Select your printer model
addImage
Adds a raster image print command to the command buffer.
Prints UIImage class graphics.
A specified area of UIImage class graphics is binarized according to the mode, halftone, and brightness parameters and converted into a raster image data.
The converted image is compressed or not compressed before transmission according to the compress parameter value.
One pixel of an image corresponds to one dot of the printer. When a transparent color is contained in the image, the background of the image is assumed to be white.
Syntax
- (int) addImage:(UIImage *)data x:(long)x y:(long)y width:(long)width height:(long)height color:(int)color mode:(int)mode halftone:(int)halftone brightness:(double)brightness compress:(int)compress; |
Parameter
data
Specifies an instance of the UIImage class.
x
Specifies the horizontal start position of the print area (in pixels).
Value |
Description |
---|---|
Integer from 0 to 65534 |
Horizontal start position of the print area (in pixels) |
y
Specifies the vertical start position of the print area (in pixels).
Value |
Description |
---|---|
Integer from 0 to 65534 |
Vertical start position of the print area (in pixels) |
width
Specifies the width of the print area (in pixels).
Value |
Description |
---|---|
Integer from 1 to 65535 |
Width of the print area (in pixels). |
height
Specifies the height of the print area (in pixels).
Value |
Description |
---|---|
Integer from 1 to 65535 |
Height of the print area (in pixels). |
color
Specifies the color.
Value |
Description |
---|---|
EPOS2_COLOR_NONE |
No printing |
EPOS2_COLOR_1 |
First color |
EPOS2_COLOR_2 |
Second color |
EPOS2_COLOR_3 |
Third color |
EPOS2_COLOR_4 |
Fourth color |
EPOS2_PARAM_DEFAULT |
Specifies the default value (first color). |
mode
Specifies the color mode.
Value |
Description |
---|---|
EPOS2_MODE_MONO |
Monochrome (2 scales) |
EPOS2_MODE_GRAY16 |
Multi-gradation (16 scales) |
EPOS2_MODE_MONO_HIGH_DENSITY |
Monochrome (2 scales), double density |
EPOS2_PARAM_DEFAULT |
Specifies the default (monochrome (2 scales)). |
halftone
Specifies the halftone processing method.
Value |
Description |
---|---|
EPOS2_HALFTONE_DITHER |
Dithering (appropriate for printing graphics only) |
EPOS2_HALFTONE_ERROR_DIFFUSION |
Error diffusion (appropriate for printing text and graphics) |
EPOS2_HALFTONE_THRESHOLD |
Threshold (appropriate for printing text only) |
EPOS2_PARAM_DEFAULT |
Specifies the default (dithering). |
Effective for the monochrome (2 scales) color mode only.
brightness
Specifies the brightness compensation value.
Value |
Description |
---|---|
Real number from 0.1 to 10.0 |
Brightness compensation (gamma correction) value |
EPOS2_PARAM_DEFAULT |
Default (1.0) |
When a value other than 1.0 is specified for the brightness compensation value, processing gets slower.
compress
Enables or disables compression.
Compressing print images can prevent white banding or streaks from occurring on printed images.
This works well when connecting with the printer using Bluetooth.
Value |
Description |
---|---|
EPOS2_COMPRESS_DEFLATE |
Compresses the image. |
EPOS2_COMPRESS_NONE |
Does not compress the image. |
EPOS2_COMPRESS_AUTO |
Automatically chooses to or not to compress the image. |
EPOS2_PARAM_DEFAULT |
Default |
Return value
Error status |
Description |
---|---|
EPOS2_SUCCESS |
The function was executed successfully. |
EPOS2_ERR_PARAM |
An invalid parameter was passed. |
EPOS2_ERR_MEMORY |
Memory necessary for processing could not be allocated. |
EPOS2_ERR_FAILURE |
An unknown error occurred. |
Supplementary explanation
- Since it takes time to send and receive large amounts of data over BLE connection, this API cannot be used with BLE connection.
- Use this API at the "beginning of a line." If this API is used elsewhere, it will be ignored.
- If the area specified by x/y and width/height does not fit within the image size specified by data parameter, EPOS2_ERR_PARAM will be returned.
- The "compress" parameter is effective when the printer is connected via Bluetooth. For other printers, specify EPOS2_COMPRESS_AUTO.
-
Model
Restriction
TM-m10
No restriction
TM-m30/TM-m30II/TM-m30II-H/TM-m30II-NT/TM-m30II-S/
TM-m30II-SL/TM-m30III/TM-m30III-HNo restriction
TM-m50/TM-m50II-H
No restriction
TM-P20/TM-P20II
No restriction
TM-P60II (Receipt)
Firmware version 5.14 ESC/POS or later
TM-P60II (Peeler)
Firmware version 6.14 ESC/POS or later
TM-P80
Firmware version 1.02 ESC/POS or later
TM-P80AC
Firmware version 2.01 ESC/POS or later
TM-P80II
No restriction
TM-T20II/TM-T20III
No restriction
TM-T70II
No restriction
TM-T82III
No restriction
TM-T88V/TM-T88VI
No restriction
- Printing may get slower if a transparent image is printed.
- The multi-gradation and the compression of image data are not supported in the page mode. If you set those in the page mode, nothing will be printed.
- Set an image size appropriate for the printer. If you set to print a large image, the API commands will be succeeded, but the printer may print nothing.
- This API consumes a lot of the buffer provided in the printer. When using this API for Epos2LFCPrinter class, be sure to check the buffer size of the printer.
Quick Access
- [Name]
- [Format]
- [Range]
- [Description]
- [Notes]
- Introduction
- help
- Epos2Printer class
- initWithPrinterSeries
- connect
- disconnect
- startMonitor
- stopMonitor
- getStatus
- sendData
- beginTransaction
- endTransaction
- requestPrintJobStatus
- clearCommandBuffer
- addTextAlign
- addLineSpace
- addTextRotate
- addText
- addTextLang
- addTextFont
- addTextSmooth
- addTextSize
- addTextStyle
- addHPosition
- addFeedUnit
- addFeedLine
- addImage
- addLogo
- addBarcode
- addSymbol
- addHLine
- addVLineBegin
- addVLineEnd
- addPageBegin
- addPageEnd
- addPageArea
- addPageDirection
- addPagePosition
- addPageLine
- addPageRectangle
- addRotateBegin
- addRotateEnd
- addCut
- addPulse
- addSound
- addFeedPosition
- addLayout
- addCommand
- getMaintenanceCounter
- resetMaintenanceCounter
- getPrinterSetting
- setPrinterSetting
- getPrinterSettingEx
- setPrinterSettingEx
- setPrinterSettingEx[Obsolete]
- verifyPassword
- getPrinterInformation
- downloadFirmwareList
- getPrinterFirmwareInfo
- verifyUpdate
- updateFirmware
- forceRecover
- forcePulse
- forceStopSound
- forceCommand
- forceReset
- setStatusChangeEventDelegate
- setReceiveEventDelegate
- setGetPrinterSettingExDelegate
- setSetPrinterSettingExDelegate
- setVerifyPasswordDelegate
- interval
- Epos2LFCPrinter class
- Epos2HybridPrinter class
- initWithLang
- connect
- disconnect
- startMonitor
- stopMonitor
- getStatus
- sendData
- beginTransaction
- endTransaction
- clearCommandBuffer
- selectPaperType
- waitInsertion
- cancelInsertion
- ejectPaper
- readMicrData
- cleanMicrReader
- forceRecover
- forcePulse
- forceCommand
- forceReset
- paperType
- interval
- waitTime
- mode40Cpl
- setStatusChangeEventDelegate
- setReceiveEventDelegate
- Epos2LineDisplay class
- initWithDisplayModel
- connect
- disconnect
- getStatus
- sendData
- clearCommandBuffer
- addInitialize
- addCreateWindow
- addDestroyWindow
- addSetCurrentWindow
- addClearCurrentWindow
- addCreateScreen
- addCreateScreenCustom
- addCreateTextArea
- addDestroyTextArea
- addSetCurrentTextArea
- addClearCurrentTextArea
- addSetCursorPosition
- addMoveCursorPosition
- addSetCursorType
- addText
- addReverseText
- addMarqueeText
- addSetBlink
- addSetBrightness
- addBackgroundColor
- addStartSlideShow
- addStopSlideShow
- addDownloadImage
- addRegisterDownloadImage
- addNVImage
- addClearImage
- addSymbol
- addClearSymbol
- addShowClock
- addCommand
- setReceiveEventDelegate
- Epos2Keyboard class
- Epos2POSKeyboard class
- Epos2BarcodeScanner class
- Epos2MSR class
- Epos2SimpleSerial class
- Epos2GermanyFiscalElement class
- Epos2OtherPeripheral class
- Epos2CommBox class
- Common to all classes
- Epos2Discovery class
- Epos2Log class
- Epos2BluetoothConnection class
- EasySelect class
- EasySelectInfo class
- Appendix
- Status list
- Key code list
- List of Supported Classes
- List of Supported APIs
- Printer-specific Support Information
- TM-m10
- TM-m30
- TM-m30II
- TM-m30II-H
- TM-m30II-NT
- TM-m30II-S
- TM-m30II-SL
- TM-m30III
- TM-m30III-H
- TM-m50
- TM-m50II
- TM-m50II-H
- TM-T20
- TM-T20II
- TM-T20III
- TM-T20IIIL
- TM-T20IV-L
- TM-T20X
- TM-T20X-II
- TM-T60
- TM-T70
- TM-T70II
- TM-T81II
- TM-T81III
- TM-T82
- TM-T82II
- TM-T82III
- TM-T82IIIL
- TM-T82IV-L
- TM-T82X
- TM-T82X-II
- TM-T83III
- TM-T83IV
- TM-T88V
- TM-T88VI
- TM-T88VII
- TM-T100
- TM-L90 Liner-Free Label Printer Model
- TM-L100
- TM-U220
- TM-U330
- TM-P20
- TM-P20II
- TM-P60 (Receipt)
- TM-P60 (Peeler)
- TM-P60II (Receipt)
- TM-P60II (Peeler)
- TM-P80
- TM-P80II
- TM-H6000V
- TM-T20II-i
- TM-T70-i
- TM-T82II-i
- TM-T83II-i
- TM-T88V-i
- TM-T88VI-iHUB
- TM-U220-i
- TM-T70II-DT
- TM-T70II-DT2
- TM-T88V-DT
- TM-T88VI-DT2
- TM-H6000IV-DT
- TM-T88IV
- TM-T90
- TM-L90
- TM-H6000IV
- Usage restriction by firmware version