控件修改之: EasyGrid打印问题

EasyGrid 存在打印问题, 某些列可能打印不全


procedure GetResolution;
var
  DC: HDC;
begin
  DC := GetDC(0);
  try
    ScreenPixelsPerInchX := GetDeviceCaps(DC, LOGPIXELSX);
    ScreenPixelsPerInchY := GetDeviceCaps(DC, LOGPIXELSY);
    ScreenPixelsPerMmX := Round(ScreenPixelsPerInchX / MmsPerInch);
    ScreenPixelsPerMmY := Round(ScreenPixelsPerInchY / MmsPerInch);
    if HasPrinter then
      begin
        PrinterPixelsPerInchX := GetDeviceCaps(Printer.Handle, LOGPIXELSX);
        PrinterPixelsPerInchY := GetDeviceCaps(Printer.Handle, LOGPIXELSY);
      end
    else
      begin
        PrinterPixelsPerInchX := 300;// 180; //修改这里
        PrinterPixelsPerInchY := 300;//180;//修改这里
      end;
    PrinterPixelsPerMmX := Round(PrinterPixelsPerInchX / MmsPerInch);
    PrinterPixelsPerMmY := Round(PrinterPixelsPerInchY / MmsPerInch);
    ScreenToPrinterX := ScreenPixelsPerInchX / PrinterPixelsPerInchX;
    ScreenToPrinterY := ScreenPixelsPerInchY / PrinterPixelsPerInchY;
  finally
    ReleaseDC(0, DC);
  end;
end;

posted @ 2009-09-21 11:23  苹果X1  阅读(322)  评论(0编辑  收藏  举报