In Windows Forms Application, I m trying to open the image (CMYK tiff), add text, and then save back to CMYK tiff image, but when I opened the output image in Photoshop, it was RGB image (the colors looked different from the input image). Following is the code and I appreciate if you could help me.
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);