Delphi FMX Android 使用商米 V2 设备打印

问题描述 投票:0回答:1

我正在 Delphi FMX Android 中寻找一个简单的例程来使用我的设备商米 V2 进行打印? 该设备具有内置热敏打印机。

我开始看这个 https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Printing_from_a_FireMonkey_Application 但这仅适用于 Windows。

这是一个开始的作品:

var
  SrcRect, DestRect: TRectF;
begin
  { Set the default DPI for the printer. The SelectDPI routine defaults
    to the closest available resolution as reported by the driver. }
  Printer.ActivePrinter.SelectDPI(1200, 1200);
  { Start printing. }
  Printer.BeginDoc;
 
  if Printer.Canvas.BeginScene then
  try
    { Set canvas filling style. }
    Printer.Canvas.Fill.Color := claBlack;
    Printer.Canvas.Fill.Kind := TBrushKind.Solid;
 
    { Set the Source and Destination TRects. }
    SrcRect := Image1.LocalRect;
    DestRect := TRectF.Create(0, 0, Printer.PageWidth, Printer.PageHeight);
 
    { Print the picture on all the surfaces of the page and all opaque. }
    Printer.Canvas.DrawBitmap(Image1.Bitmap, SrcRect, DestRect, 1);
  finally
    Printer.Canvas.EndScene;
  end;
 
  { Finish printing job. }
  Printer.EndDoc;
end;
android delphi firemonkey thermal-printer
1个回答
0
投票

没有人回答这个问题, 我还需要知道怎么办? 请帮忙

© www.soinside.com 2019 - 2024. All rights reserved.