Доброго времени суток! Такая вот проблема, есть код вывода на принтер, теперь поменялись билетики и надо текст выводить вертикально. Как реализовать именно в этом контексте, не могу понять. Буду очень рада если Вы поможете мне
| Код | Procedure TF_main.GetPrinterInfo; begin PixelsX:=GetDeviceCaps(printer.Handle,LogPixelsX); PixelsY:=GetDeviceCaps(printer.Handle,LogPixelsY); MX := GetDeviceCaps(Printer.Handle, PHYSICALOFFSETX); MY := GetDeviceCaps(Printer.Handle, PHYSICALOFFSETY); end;
Function TF_main.PX(x:integer):integer; begin PX:=round(PixelsX/25.4*x); end; Function TF_main.PY(Y:integer):integer; begin PY:=round(PixelsY/25.4*Y); end;
function TF_main.printticket(ser,price,name,date,time,screen,row,place:string):boolean; var i:integer; begin with printer do canvas.Font.Name:='Arial'; canvas.Font.Size:=6; canvas.Font.Style:=[]; canvas.textout(px(1),py(4),ser); canvas.textout(px(55),py(15),ser); canvas.Font.Size:=10; canvas.Font.Style:=[fsBold]; canvas.Font.Color:=CLBlack; canvas.textout(px(57),py(4),price); canvas.textout(px(38)-round(printer.canvas.textwidth(name)/2),py(36),name); canvas.textout(px(19)-round(printer.canvas.textwidth(date)/2),py(44),date); canvas.textout(px(57)-round(printer.canvas.textwidth(screen)/2),py(44),screen); canvas.textout(px(19)-round(printer.canvas.textwidth(time)/2),py(50),time); canvas.textout(px(57)-round(printer.canvas.textwidth(row)/2),py(50),row); canvas.textout(px(19)-round(printer.canvas.textwidth(price)/2),py(57),price); canvas.textout(px(57)-round(printer.canvas.textwidth(place)/2),py(57),place);}
end; end;
|
|