Confidential
MTP7632 Programming Manual
Telpar 800-872-4886 73 -
//Utility
:
Transform bmp format bit image into printer processable data //
//Parameter
:
pBmpData---Pointer to source data //
// nPixelsOfWidth----bit image width
(
in dots
)
//
// nPixelsOfHeight---bit image height
(
in dots
)
//
// pBmpDataRotated---Pinter to target data //
//Value return
:
1: data transformation ok. 0: parameter error. //
//************************************************//
int AntiRotateBmp90D(
char *pBmpData,
const int nPixelsOfWidth,
const int nPixelsOfHeight,
char *pBmpDataRotated
)
{
// Define process variables
int nBytesOfWidth = 0,nBytesOfHeight = 0;
int i=0,col=0,row=0,index = 0,colbyte = 0;
char*
midData;
unsigned char tempdata = 0,colnum = 0,rownum = 0;
unsigned char temp[8] = {0x80,0x40,0x20,0x10,0x08,0x04,0x02,0x01};
//Comparing parameters
if (pBmpData == NULL || pBmpDataRotated == NULL) return 0;
if (nPixelsOfWidth <= 0 || nPixelsOfHeight <= 0) return 0;
if ((nPixelsOfWidth % 8) != 0 || (nPixelsOfHeight % 8) != 0) return 0;
//get real image dimension
nBytesOfWidth = (nPixels31)/32*4;
nBytesOfHeight = nPixelsOfHeight / 8;
//White/black reverse,the value 1 in BMP data is for white which is contrary to the printer definition.
midData = (char*)malloc(nBytesOfWidth*nPixelsO1);
for(i=0;i<nBytesOfWidth*nPixelsOfHeight;i++){midData[i] = 0xff-pBmpData[i];}
//Rotation. BMP data is arranged in line data type while data downloaded to printer are arranged in
column data type.
for (row = 0; row <nPixelsOfWidth; row++){
for (colbyte = 0; colbyte < nBytesOfHeight; +){
index = row * nBytesOf colbyte;
pBmpDataRotated[index] = 0x00;
Содержание MTP7632
Страница 85: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 79 Code Page 1 Katakana ...
Страница 86: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 80 Code Page 2 PC850 Multilingual ...
Страница 87: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 81 Code Page 3 PC860 Portuguese ...
Страница 88: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 82 Code Page 4 PC863 Canadian French ...
Страница 89: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 83 Code Page 5 PC865 Nordic ...
Страница 90: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 84 Code Page 16 WPC1252 ...
Страница 91: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 85 Code Page 17 PC866 Cyrillic 2 ...
Страница 92: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 86 Code Page 18 PC852 Latin2 ...
Страница 93: ...Confidential MTP7632 Programming Manual Telpar 800 872 4886 87 Code Page 19 PC858 ...