在 Windows 窗体应用程序中,我试图打开图像(CMYK tiff),添加文本,然后保存回 CMYK tiff 图像,但是当我在 Photoshop 中打开输出图像时,它是 RGB 图像(颜色看起来与输入图像)。以下是代码,如果您能帮助我,我将不胜感激。
Image^ chartImg = Image::FromFile( "user_chart.tif" );
Graphics^ g = System::Drawing::Graphics::FromImage(chartImg);
String^ drawString = "Test test test test";
System::Drawing::Font^ drawFont = gcnew System::Drawing::Font("Arial", 9);
System::Drawing::SolidBrush^ drawBrush = gcnew
System::Drawing::SolidBrush(System::Drawing::Color::Black);
float x = 100.0F;
float y = 10.0F;
System::Drawing::StringFormat^ strFormat = gcnew System::Drawing::StringFormat();
g->DrawString(drawString, drawFont, drawBrush, x, y, strFormat);
chartImg->Save("user_chart2.tif", System::Drawing::Imaging::ImageFormat::Tiff);