Board index » delphi » Graphics screen dump to Epson Stlus Photo

Graphics screen dump to Epson Stlus Photo

Hi,

Does anyone have any source code to a Borland/Turbo Pascal graphics screen
dump procedure to print to an Epson Stylus Photo printer that they are
willing to share?

I have tried to modify the Borland sample code from an old technical
information document for a HP LaserJet printer, but without success. I
looked up the Epson-Stlus-specific printer control codes, but I can't get
my code to work.

--
Witold.

 

Re:Graphics screen dump to Epson Stlus Photo


Witold schrieb:

Quote
> Hi,

> Does anyone have any source code to a Borland/Turbo Pascal graphics screen
> dump procedure to print to an Epson Stylus Photo printer that they are
> willing to share?

> I have tried to modify the Borland sample code from an old technical
> information document for a HP LaserJet printer, but without success. I
> looked up the Epson-Stlus-specific printer control codes, but I can't get
> my code to work.

> --
> Witold.

Hello!

Someone searches for this too. He already e-mailed me privately because
I offered to look at my old code. There is something you might want. It
is only b/w without dithering, but it may show the idea. If you like
this, mail me privately too. I still have to look it up though.

Greetings

Markus

Re:Graphics screen dump to Epson Stlus Photo


"Witold" <noth...@nothere.com> schreef in bericht
news:3df3242f$0$25755$afc38c87@news.optusnet.com.au...

Quote
> Hi,

> Does anyone have any source code to a Borland/Turbo Pascal graphics
screen
> dump procedure to print to an Epson Stylus Photo printer that they are
> willing to share?

> I have tried to modify the Borland sample code from an old technical
> information document for a HP LaserJet printer, but without success. I
> looked up the Epson-Stlus-specific printer control codes, but I can't
get
> my code to work.

I have some very very very old code which is for a matrix printer. I
don't think that will work.

The method I use is as follows.

You have to run your graphic program under Windows.
The screen resolution has to be 640x480 VGA resolution.
Run your program that shows the grapic picture or drawing nicely on
screen, Press the
ALT + PrtScr buttons simultaneously.
This copies the drawing as a bitmap to the windows clipboard.
Now open any windows program that can handle bitmaps, e.g. MS Word. Now
paste the clipboard picture in the document (Press CTRL C or paste from
the menu). That's it now print it from the windows program.

Maybe you must have the word program already open before copying.

Good luck

Femme

Re:Graphics screen dump to Epson Stlus Photo


JRS:  In article <3df3242f$0$25755$afc38...@news.optusnet.com.au>, seen
in news:comp.lang.pascal.borland, Witold <noth...@nothere.com> posted at
Sun, 8 Dec 2002 11:51:27 :-

Quote
> I
>looked up the Epson-Stlus-specific printer control codes,

Where did you find these?

--
? John Stockton, Surrey, UK.  j...@merlyn.demon.co.uk   Turnpike v4.00   MIME. ?
  <URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
  <URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> Pedt Scragg: c.l.p.b. mFAQ;
  <URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

Re:Graphics screen dump to Epson Stlus Photo


Quote
In article <uva6vd98cj5...@corp.supernews.com>, "Femme Verbeek" <fv[at]{*word*104}jet[dot]nl> wrote:
>The method I use is as follows.

>You have to run your graphic program under Windows.
>The screen resolution has to be 640x480 VGA resolution.
>Run your program that shows the grapic picture or drawing nicely on
>screen, Press the
>ALT + PrtScr buttons simultaneously.
>This copies the drawing as a bitmap to the windows clipboard.
>Now open any windows program that can handle bitmaps, e.g. MS Word. Now
>paste the clipboard picture in the document (Press CTRL C or paste from
>the menu). That's it now print it from the windows program.

>Maybe you must have the word program already open before copying.

Femme,

Thanks for the tip. However, I really need to be able to print from my
Borland Pascal DOS program.

--
Witold.

Re:Graphics screen dump to Epson Stlus Photo


In article <yrgAWOAcBS99E...@merlyn.demon.co.uk>, Dr John Stockton <re...@merlyn.demon.co.uk> wrote:

Quote
>JRS:  In article <3df3242f$0$25755$afc38...@news.optusnet.com.au>, seen
>in news:comp.lang.pascal.borland, Witold <noth...@nothere.com> posted at
>Sun, 8 Dec 2002 11:51:27 :-
>> I
>>looked up the Epson-Stylus-specific printer control codes,

>Where did you find these?

John,

I downloaded copies of the appropriate manuals from the Epson web site. I
found manuals for the Epson Stylus C60, as well as the Epson Stylus Photo
810/820. I used the latter to see if there were any major differences that
might affect me, which there did not seem to be.

The URL that should enable you to eventually get to the printer manuals
is:

  http://www.epsondevelopers.com/

You will need to register to gain access, though.

Regards,

--
Witold.

Re:Graphics screen dump to Epson Stlus Photo


"Witold" <noth...@nothere.com> schreef in bericht
news:3df5aca9$0$18872$afc38c87@news.optusnet.com.au...

Quote
> In article <uva6vd98cj5...@corp.supernews.com>, "Femme Verbeek"
<fv[at]{*word*104}jet[dot]nl> wrote:
> >The method I use is as follows.

> >You have to run your graphic program under Windows.
> >The screen resolution has to be 640x480 VGA resolution.
> >Run your program that shows the grapic picture or drawing nicely on
> >screen, Press the
> >ALT + PrtScr buttons simultaneously.
> >This copies the drawing as a bitmap to the windows clipboard.
> >Now open any windows program that can handle bitmaps, e.g. MS Word.
Now
> >paste the clipboard picture in the document (Press CTRL C or paste
from
> >the menu). That's it now print it from the windows program.

> >Maybe you must have the word program already open before copying.

> Femme,

> Thanks for the tip. However, I really need to be able to print from my
> Borland Pascal DOS program.

FWIW

here's the hardcopy procedure. Perhaps you can modify it for the stylus
printer.

--
Femme

uses dos,printer,graph;

procedure hardcopy(inverse:boolean;mode:byte); { EPSON Printer}

  var gi,gj,top:integer;
      ColorLoc,PrintByte:byte;

  Procedure sendbyte(B : byte);     {send one byte to printer}
  const Lptportnum = 1;
  var Regs :registers ;
  begin
    Regs.ah := 0;
    Regs.al := B;
    regs.dx := Pred(Lptportnum);
    intr($17,regs);
  end;

  function pd(x,y:integer):boolean;
    begin
      pd:=not(GetPixel(x,y)=0);
    end;

  procedure doline(top:integer);

    function ConstructByte(tj,ti:integer):byte;
      const Bits:array [0..7] of byte=(128,64,32,16,8,4,2,1);
      var CByte,k:byte;
      begin {constructbyte}
        ti:=ti shl 3;
        CByte:=0;
        for k:=0 to top do
          if PD(tj,ti+k) then CByte:=CByte or Bits[k];
        ConstructByte:=CByte;
      end;{constructbyte}

    var li,lj:integer;

    begin {doline}
      if mode=1 then write(lst,#27'L')
      else write(lst,#27'*',chr(mode));
      write(lst,chr(lo(getMaxX+1)),chr(Hi(getMaxX+1)));
      for lj :=0 to getmaxx do {getmaxx}
       begin
        PrintByte:=ConstructByte(lj,gi);
        if inverse then PrintByte:=not PrintByte;
        sendbyte(PrintByte);
       end;
{      if mode<>4 then} writeln(lst);
    end;{doline}

  begin{hardcopy}
    top:=7;
    ColorLoc:=getColor;
    setColor(255);
    mode:=mode and 7;
    if (mode=5) or (mode=0) then mode:=4;

    write(lst,#27'3'#24);

   for gi:=0 to ((getMaxY+1) shr 3)-1 do doline(7);
    gi:=((getMaxY+1) shr 3);
    if (getMaxY+1) and 7<>0 then
      doline((getMaxY+1) and 7);
    writeln(lst,^['2');
    setColor(ColorLoc);
  end;

Re:Graphics screen dump to Epson Stlus Photo


Please DO give me your E-Mail adress, since I will send you source code
which will SOLVE your problem or at least TEACH you how to solve it
yourself!

Greetings

Markus

Re:Graphics screen dump to Epson Stlus Photo


Quote
In article <3DF61C5E.10...@freenet.de>, Markus Humm <markus.h...@freenet.de> wrote:
>Please DO give me your E-Mail adress, since I will send you source code
>which will SOLVE your problem or at least TEACH you how to solve it
>yourself!

Markus,

Thanks for digging out the old source code. You e-mailed it to me today.
I'll give it a try as soon as I can.

--
Witold.

Other Threads