views:

63

answers:

0
+1  Q: 

Print CMYK image

I have CMYK image in TIFF format and would like to print it in my Windows Forms application. But, when I looked at the color of the print, it didn't look right. So, my guess is that the data sent to the printer was treated as RGB rather than CMYK (When I printed the CMYK image in Photoshop, it printed the correct color). So, my question is how you print (send) CMYK image data to the printer?

Below is my code and I would appreciate any of your help or comments:

    m_pPrintFileFullName = openFileDialog->FileName;

    m_pPrintDocument = gcnew PrintDocument;
    m_pPrintDocument->PrintPage += gcnew PrintPageEventHandler(this, &Form1::DocPrintPage);
    m_pPrintDocument->DefaultPageSettings->Landscape = true;

    PrintDialog^ printDialog = gcnew PrintDialog();
    printDialog->Document = m_pPrintDocument;

    result = printDialog->ShowDialog();
    if (result == System::Windows::Forms::DialogResult::Cancel)
        return;

    m_pPrintDocument->Print();
}

private: System::Void DocPrintPage(System::Object^  sender, PrintPageEventArgs^  e) {
    float x, y;

    Image^ img = Image::FromFile(m_pPrintFileFullName);

    x = (float)e->MarginBounds.Left;
    y = (float)e->MarginBounds.Top;
    e->Graphics->DrawImage(img, x, y);
}