Re: FS q command
- From: erewhon@xxxxxxxxxx (J French)
- Date: Tue, 31 Jan 2006 18:30:38 +0000 (UTC)
On 31 Jan 2006 09:32:54 -0800, "DelphiNew" <jcalata@xxxxxxxxxxx>
wrote:
>Any example about using ESC * command ?
>
>I'm trying to use it but I don't know how to send my bitmap (110x109
>pixels). This bitmap is 2 colour, but I'm unable to obtain n1, n2 and
>Data values.
>
>How can I do it?
Unfortunately I don't have an ESC/P printer handy
However I think that you need to send each line of the graphic
separately
Var
BM :TBitmap;
S, Data :String;
W, L9 :Integer;
Begin
BM := TBitmap.Create;
BM.LoadFromFile( 'c:\somebitmap.bmp' );
BM.Mask( BM.Canvas.Pixels[ 0, 0 ] ); // Make monochrome
W := BM.Width;
SetLength( Data, (W + 7) Div 8 )
For L9 := 0 To BM.Height - 1 Do
Begin
S := #27'*'#0 + Chr( W Mod 256 ) + Chr( W Div 256 ) ;
Move( BM.ScanLine[ L9 ], Data[1], Length( Data ) );
S := S + Data ;
// send line in S to port
End;
These commands come from
http://www.pcguru.plus.com/escp2.html
ESC K Nl Nh d1 ... dk Select 60 dpi graphics (Nl,Nh=Dot columns)
ESC L Nl Nh d1 ... dk Select 120 dpi graphics
ESC Y Nl Nh d1 ... dk Select 120 dpi double speed graphics
ESC Z Nl Nh d1 ... dk Select 240 dpi graphics
ESC ^ m Nl Nh d1 ... dk Select 60/120 dpi 9pin graphics (m=0 60dpi,
m=1 120dpi)
There is also ESC . for ESC/P2 Raster Graphics that looks rather
interesting, but that might be more difficult fishing out the data
from a standard Bitmap
I can't remember whether the printer drops a 'bit' or line after each
chunk of graphics - my long term memory is a little .. tired
Your best bet is to make lines of #255#0#128 etc and experiment with
sending them to the printer, when you have that working you can then
try fishing the data from the Bitmap
.
- References:
- FS q command
- From: DelphiNew
- Re: FS q command
- From: J French
- Re: FS q command
- From: DelphiNew
- FS q command
- Prev by Date: Re: FS q command
- Next by Date: Re: Folding Editor
- Previous by thread: Re: FS q command
- Index(es):
Relevant Pages
|
|