Hi,
I post here my code for testing CMYK printing.
Maybe somebody can take a look at it and tell me why it doesn't work (it
prints one black and one blue rectangle).
I use Apple Color LW 12/660 PS to create PostScript.
Thank You
--Tim
class procedure TICM.PrintTest;
var
hDC_: HDC;
diDocInfo: DOCINFO;
lcs: LOGCOLORSPACE;
hTransform: HCMTRANSFORM;
profile: tagPROFILE;
lpszFilename: PChar;
hProfile_: HPROFILE;
type
TCHAR = char;
begin
lpszFilename :=
'C:\WINDOWS\system32\spool\DRIVERS\COLOR\Photoshop4DefaultCMYK.icc';
hDC_ := GetPrinterDC();
if hDC_ = 0 then
RaiseLastOSError;
// Fill in the DOCINFO structure
diDocInfo.cbSize := sizeof(DOCINFO);
diDocInfo.lpszDocName := 'sdft';
diDocInfo.lpszOutput := nil;
diDocInfo.lpszDatatype := nil;
diDocInfo.fwType := 0;
// Start the document
if StartDoc(hDC_, diDocInfo) = SP_ERROR then
RaiseLastOSError;
// Start the page
if StartPage(hDC_) = SP_ERROR then
RaiseLastOSError;
// I tested although ICM_ON
if SetICMMode(hDC_, ICM_DONE_OUTSIDE_DC) = 0 then
RaiseLastOSError;
if not SetICMProfile(hdc_, lpszFilename) then
RaiseLastOSError;
SelectObject(hdc_, CreateSolidBrush(CMYK(255, 0, 0, 0)));
Rectangle(hDC_, 0, 0, 1000, 100);
SelectObject(hdc_, CreateSolidBrush(CMYK(0, 255, 0, 0)));
Rectangle(hDC_, 0, 100, 1000, 200);
// Local variables
if EndPage(hDC_) = SP_ERROR then
RaiseLastOSError;
if EndDoc(hDC_) = SP_ERROR then
RaiseLastOSError;
DeleteDC(hDC_);
end;
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r
_______________________________________________
Lcms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/lcms-user