none
How to change GDI's scanline size from 216 bytes to 210 bytes RRS feed

  • Question

  • My application sends the data to GDI for printing. My driver accepts the data as 210 bytes per scanline, but GDI sends 216 bytes per scanline. 
    Is it possible to change the GDI's scanline size from 216 bytes to 210 bytes.

    Application code:-

    CDC printDC;    
    printDC.StartPage();
    printDC.Rectangle(0,0,wsize.cx - 105,-wsize.cy + 20);
    printDC.TextOut(5,-5,tout);
    printDC.TextOut(5,-wsize.cy + 70,PageNum);
    printDC.EndPage();

    //Bytes sent to the driver in a gdi packet as :-
    #define GDI_BYTES               1728 //(216 * 8)

    Expected :-

    Driver should get 210 bytes per scanline from GDI.

    Actual:-

    Driver is getting 216 bytes per scanline from GDI.

    • Edited by Pankajkb Tuesday, August 27, 2019 11:11 AM
    Tuesday, August 27, 2019 11:10 AM

All replies

  • Did you try #define GDI_BYTES (210 * 8) // 1680?.

    Tuesday, August 27, 2019 3:17 PM
  • Yes.

    Is there a way to modify in GDI so that GDI sents 210 bytes per scanline ?

    Wednesday, August 28, 2019 5:30 AM
  • Hello,

    Thank you for posting here.

    >>#define GDI_BYTES               1728 //(216 * 8)

    I can't find any relevant information on Google. Is it defined by yourself? If so, do as Viorel_ says, redefine GDI_BYTES in your program.

    Best Regards,

    Suarez Zhou

    Thursday, August 29, 2019 1:51 AM