
// Fill in the structure with info about this "document"
DocInfo.cbSize = sizeof(DOCINFO);
DocInfo.lpszDocName = L"Test Document";
DocInfo.lpszOutput = NULL;
DocInfo.lpszDatatype = 0;
DocInfo.fwType = 0;
// Inform the spooler the document is beginning.
if( (dwJob = StartDoc(PrinterDC, &DocInfo )) == 0 )
{
DeleteDC(PrinterDC);
return FALSE;
}
// Start a page.
if(!StartPage(PrinterDC))
{
EndDoc(PrinterDC);
DeleteDC(PrinterDC);
return FALSE;
}
// Send the data to the printer.
// ========================================================================
// This is just a test sequence of drawing operations.....
// Replace this code with something more useful in a production environment.
// Outline the page border
Rectangle (PrinterDC, 0, 0, xPage, yPage) ;
// Draw a pair of diagonals through the page
MoveToEx (PrinterDC, 0, 0, NULL) ;
LineTo (PrinterDC, xPage, yPage) ;
MoveToEx (PrinterDC, xPage, 0, NULL) ;
LineTo (PrinterDC, 0, yPage) ;
// Define a bounding box and output some text
Box.left = xPage/30;
Box.right = xPage - Box.left;
Box.top = 2 * (yPage/8);
Box.bottom = 6 * (yPage/8);
Rectangle(PrinterDC, Box.left, Box.top, Box.right, Box.bottom);
SetTextAlign (PrinterDC, TA_LEFT|TA_TOP) ;
DrawText(PrinterDC, TextStr, -1, &Box, DT_LEFT | DT_WORDBREAK);
// Copy a bitmap image to the printer device context.
MemoryDC = CreateCompatibleDC(NULL);
SelectObject(MemoryDC, BitmapHandle);
BitBlt(PrinterDC, 0, 180, BitmapInfo.bmWidth, BitmapInfo.bmHeight,
MemoryDC, 0, 0, SRCCOPY);
DeleteDC(MemoryDC);
// End of test sequence
// ========================================================================
// End the page.
if(!EndPage(PrinterDC))
{
EndDoc(PrinterDC);
DeleteDC(PrinterDC);
return FALSE;
}
// Inform the spooler that the document is ending.
if(!EndDoc(PrinterDC))
{
DeleteDC(PrinterDC);
return FALSE;
}
// Tidy up the printer handle.
DeleteDC(PrinterDC);
Содержание Pro60
Страница 1: ...Blackroc Pro60 Thermal Printer Programming Manual March 2007 V1 4 ...
Страница 21: ...DeleteObject BitmapHandle return TRUE ...
Страница 24: ...Windows Mobile 2003 ...
Страница 25: ......
Страница 26: ...Alphabetical Index ...