Commit 83d4560c authored by Huw D M Davies's avatar Huw D M Davies Committed by Alexandre Julliard

PSDRV_StretchDIBits should use logical co-ords.

Some versions of ghostscript seem to eat one too many characters of image data. Add a '%' to the output file to work around this.
parent 6f40d25d
...@@ -125,6 +125,10 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -125,6 +125,10 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
return FALSE; return FALSE;
} }
xDst = XLPTODP(dc, xDst);
yDst = YLPTODP(dc, yDst);
widthDst = XLSTODS(dc, widthDst);
heightDst = YLSTODS(dc, heightDst);
switch(bpp) { switch(bpp) {
...@@ -138,7 +142,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -138,7 +142,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
FIXME(psdrv, "This won't work...\n"); FIXME(psdrv, "This won't work...\n");
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteBytes(dc, ptr + xSrc/8, widthSrc/8); PSDRV_WriteBytes(dc, ptr + xSrc/8, widthSrc/8);
PSDRV_WriteGRestore(dc);
break; break;
case 4: case 4:
...@@ -151,7 +154,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -151,7 +154,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
FIXME(psdrv, "This won't work...\n"); FIXME(psdrv, "This won't work...\n");
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteBytes(dc, ptr + xSrc/2, widthSrc/2); PSDRV_WriteBytes(dc, ptr + xSrc/2, widthSrc/2);
PSDRV_WriteGRestore(dc);
break; break;
case 8: case 8:
...@@ -162,7 +164,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -162,7 +164,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
ptr += (ySrc * widthbytes); ptr += (ySrc * widthbytes);
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteBytes(dc, ptr + xSrc, widthSrc); PSDRV_WriteBytes(dc, ptr + xSrc, widthSrc);
PSDRV_WriteGRestore(dc);
break; break;
case 15: case 15:
...@@ -175,7 +176,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -175,7 +176,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
ptr += (ySrc * widthbytes); ptr += (ySrc * widthbytes);
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteDIBits16(dc, (WORD *)ptr + xSrc, widthSrc); PSDRV_WriteDIBits16(dc, (WORD *)ptr + xSrc, widthSrc);
PSDRV_WriteGRestore(dc);
break; break;
case 24: case 24:
...@@ -187,7 +187,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -187,7 +187,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
ptr += (ySrc * widthbytes); ptr += (ySrc * widthbytes);
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteDIBits24(dc, ptr + xSrc * 3, widthSrc); PSDRV_WriteDIBits24(dc, ptr + xSrc * 3, widthSrc);
PSDRV_WriteGRestore(dc);
break; break;
case 32: case 32:
...@@ -199,7 +198,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -199,7 +198,6 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
ptr += (ySrc * widthbytes); ptr += (ySrc * widthbytes);
for(line = 0; line < heightSrc; line++, ptr += widthbytes) for(line = 0; line < heightSrc; line++, ptr += widthbytes)
PSDRV_WriteDIBits32(dc, ptr + xSrc * 3, widthSrc); PSDRV_WriteDIBits32(dc, ptr + xSrc * 3, widthSrc);
PSDRV_WriteGRestore(dc);
break; break;
default: default:
...@@ -207,7 +205,10 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst, ...@@ -207,7 +205,10 @@ INT PSDRV_StretchDIBits( DC *dc, INT xDst, INT yDst, INT widthDst,
return FALSE; return FALSE;
} }
PSDRV_WriteSpool(dc, "%\n", 2); /* some versions of ghostscript seem to
eat one too many chars after the image
operator */
PSDRV_WriteGRestore(dc);
return TRUE; return TRUE;
} }
......
...@@ -299,6 +299,7 @@ extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number); ...@@ -299,6 +299,7 @@ extern BOOL PSDRV_WriteBytes(DC *dc, const BYTE *bytes, int number);
extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number); extern BOOL PSDRV_WriteDIBits16(DC *dc, const WORD *words, int number);
extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number); extern BOOL PSDRV_WriteDIBits24(DC *dc, const BYTE *bits, int number);
extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number); extern BOOL PSDRV_WriteDIBits32(DC *dc, const BYTE *bits, int number);
extern int PSDRV_WriteSpool(DC *dc, LPSTR lpData, WORD cch);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment