A artist Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-13 #21 Another_eYes大虾,对于这个问题,你有没有最新的消息?
A artist Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-13 #22 我不太清楚,你究竟要在谁的Canves上Textout东西。打印预览没有问题吗?
A artist Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-14 #23 各位大侠,没有人有好点的办法了吗?Another_eYes同志继承QrMemo做个控件 的结果如何?
A Another_eYes Unregistered / Unconfirmed GUEST, unregistred user! 1999-10-14 #24 没时间呀. 临时写一个, 没有qr的源码, 瞎猜大概是这样. 你去试试吧. type TMyQRMemo = class(TQRMemo) private fIndent : Integer; public procedure Print(OfsX, OfsY: Integer); override; published Indent: Integer read fIndent write fIndent; end; implimentation procedure TMyQRMemo.Print(OfsX, OfsY: Integer); var buf: array [0..1024] of Integer; tmpS, s: string; tmpWS: WideString; i, n, CurrentY: Integer; sz: TSize; begin printer.canvas.font := font; currentY := 0; for i := 0 to lines.count-1do begin tmps := lines.strings; while length(temps) > 0do begin GetTextExtentExPoint(printer.canvas.handle, pchat(temps), length(temps), width, @n, @buf[0], @sz); tmpws := copy(tmps, 1, n); if (tmpws[length(tmpws)] = tmps[n]) and (ord(tmps[n]) > 127) then dec; s := copy(tmps, 1, n); delete(tmps, 1, n); textout(printer.canvas.handle, ofsx, ofsy + currenty, pchar(s), length(s)); inc(currenty, sz.cy+fIndent); end; end; end;
没时间呀. 临时写一个, 没有qr的源码, 瞎猜大概是这样. 你去试试吧. type TMyQRMemo = class(TQRMemo) private fIndent : Integer; public procedure Print(OfsX, OfsY: Integer); override; published Indent: Integer read fIndent write fIndent; end; implimentation procedure TMyQRMemo.Print(OfsX, OfsY: Integer); var buf: array [0..1024] of Integer; tmpS, s: string; tmpWS: WideString; i, n, CurrentY: Integer; sz: TSize; begin printer.canvas.font := font; currentY := 0; for i := 0 to lines.count-1do begin tmps := lines.strings; while length(temps) > 0do begin GetTextExtentExPoint(printer.canvas.handle, pchat(temps), length(temps), width, @n, @buf[0], @sz); tmpws := copy(tmps, 1, n); if (tmpws[length(tmpws)] = tmps[n]) and (ord(tmps[n]) > 127) then dec; s := copy(tmps, 1, n); delete(tmps, 1, n); textout(printer.canvas.handle, ofsx, ofsy + currenty, pchar(s), length(s)); inc(currenty, sz.cy+fIndent); end; end; end;