Witam znalazłem gdzieś taki kod dzięki któremu można wysłać polecenie wydrukowania textu, tylko zależy mi jeszcze żeby można było wydrukować obraz; Próbowałem to zrealizować z użyciem funkcji bitblt ale coś mi nie wychodziło. co i jak trzeba dodać jeszcze do tego kodu żeby można było wydrukować bitmape?
Za pomoc z góry dzięki.
#include <windows.h>
int main(){
HDC hdcPrint; // printer DC handle
char szDevString[120]; // array for WIN.INI data
char *szPrinter, *szDriver; // printer and driver names
char *szPort; // port name
// Retrieve the printer, printer-driver, and
// output-port names from WIN.INI.
GetProfileString("windows", "device", ",,,",
szDevString, 120);
// Parse the string of names, setting ptrs as required
// If the string contains the required names, use them to
// create a device context.
if ((szPrinter = strtok(szDevString,
(const char *) ","))
&& (szDriver = strtok ((char *) NULL,
(const char *) ", "))
&& (szPort = strtok ((char *) NULL,
(const char *) ", ")))
{
hdcPrint = CreateDC(szDriver, szPrinter,
szPort, NULL);
}
// Print a test page that contains the string
// "PRINTER TEST" in the upper left corner.
Escape(hdcPrint, STARTDOC, 8, "Test-Doc", NULL);
TextOut(hdcPrint, 50, 50, "PRINTER TEST", 12);
Escape(hdcPrint, NEWFRAME, 0, NULL, NULL);
Escape(hdcPrint, ENDDOC, 0, NULL, NULL);
// Delete the printer DC.
DeleteDC(hdcPrint);
return 0;
}