Loading ...
Sorry, an error occurred while loading the content.
 

Re: [libertybasic] Re: Txtbox and Printing

Expand Messages
  • John Fisher
    I assume you are using Windows, so mention of the Unix Make command worries me. LB is a Windows program. If you followed the link, you ll have read ( the
    Message 1 of 11 , Oct 6, 2010
      I assume you are using Windows, so mention of the Unix 'Make' command
      worries me.
      LB is a Windows program.

      If you followed the link, you'll have read ( the following are all
      quoted off the page')
      'If you are not sure which version is appropriate, choose
      ImageMagick-6.6.4-9-Q16-windows-dll.exe
      <http://www.imagemagick.org/download/binaries/ImageMagick-6.6.4-9-Q16-windows-dll.exe>.'
      It was 14.6M for me...

      Now execute- it installs a new dll.
      'The Windows version of ImageMagick is self-installing. Simply click on
      the appropriate version below and it will launch itself and ask you a
      few installation questions.'

      Then, as it says, try 'To verify ImageMagick is working
      properly, type the following in an MS-DOS Command Prompt window obtained
      by Start -->Run --> cmd in XP:

      (It installs in system folder. You'll be seeing a command
      prompt like 'C:\Documents and Settings\Tenoch>' as a prompt in front of
      the the following, which you type.


      Try typing convert /?
      You should see a help file on all the commands.

      Try typing the following. This converts an internal file called logo:
      into a gif file and displays it.
      convert logo: logo.gif
      identify logo.gif
      magick> imdisplay logo.gif

      Did this work??
      If you are unfamiliar with the command line, it IS all a bit strange.
      But you end with an installed dll you can forget about which does so
      many magic things.
      Have you looked at my page on http://www.diga.me.uk/IM.html ?

      John
    • John Fisher
      Any joy yet? Another test command is convert -version which should give version information. In my previous reply, a small mistake- ... Forget the magick bit
      Message 2 of 11 , Oct 6, 2010
        Any joy yet?

        Another test command is
        convert -version
        which should give version information.


        In my previous reply, a small mistake-
        > Try typing the following. This converts an internal file called logo:
        > into a gif file and displays it.
        > convert logo: logo.gif
        > identify logo.gif
        > magick> imdisplay logo.gif

        Forget the magick> bit in the last line- careless copying!
        Just type
        imdisplay logo.gif
      • John Fisher
        You may be interested in a contribution from Richard Russell who has ( quote) ... If you plan to distribute a program, this will be a neater solution
        Message 3 of 11 , Oct 6, 2010
          You may be interested in a contribution from Richard Russell who has (
          quote)

          > built a tiny BMP to TIFF converter (in BBC BASIC) which I've uploaded here:
          > http://www.rtr.myzen.co.uk/bmp2tiff.exe
          > The syntax is 'bmp2tiff bmpfile tiffile' and it can straightforwardly be called from LB using RUN.

          If you plan to distribute a program, this will be a <much> neater
          solution than expecting users to install IM!

          For personal use I still recommend the IM route as it allows so many
          other things.

          John F ( tenochtitlanuk)
        • John Fisher
          The tick$ is left in as a reminder because sometimes your pathname may include spaces- eg Documents and Settings , in which case you ll have to insert quotes
          Message 4 of 11 , Oct 6, 2010
            The tick$ is left in as a reminder because sometimes your pathname may
            include spaces- eg 'Documents and Settings', in which case you'll have
            to insert quotes round the relevant paths.
            See the quote at the end of my ImageMagick web page.
            >
          • henriknilson
            Thanks for all who share discussing Txtbox and Printing . I conclude that it is very complicated to print the content of Txtboxes as tif document. But it is
            Message 5 of 11 , Oct 7, 2010
              Thanks for all who share discussing "Txtbox and Printing".
              I conclude that it is very complicated to print the content of Txtboxes as tif document. But it is much easier to print the content of GRAPHICBOX like the following code hopping I am not wrong, it is only one additional line !!!:

              `The code
              nomainwin
              WindowWidth = 600
              WindowHeight = 400
              BUTTON #A.1 "Quit", [quit],UL, 500, 300, 70, 25
              BUTTON #A.Default, " Calculate ",[enter],UL, 400,300 , 70, 25
              BUTTON #A.buttonPrint,"Print",[Print], UL, 270, 257, 120, 25
              TEXTBOX #A.txtbox1, 10,60,50,25
              TEXTBOX #A.txtbox2, 10,100,50,25
              TEXTBOX #A.txtbox3, 10,140,50,25
              TEXTBOX #A.txtbox4, 10,180,50,25
              TEXTBOX #A.txtbox5, 10,220, 50, 25
              TEXTBOX #A.txtbox6, 70,60,50,25
              TEXTBOX #A.txtbox7, 70,100,50,25
              TEXTBOX #A.txtbox8, 70,140,50,25
              TEXTBOX #A.txtbox9, 70,180,50,25
              TEXTBOX #A.txtbox10, 70,220, 50, 25

              STATICTEXT #A "No.of pieces", 0,25, 250, 25
              STATICTEXT #A "Price", 80,25, 250, 25

              GRAPHICBOX #A.textresult, 180, 60, 300, 180

              OPEN "Velocity" FOR DIALOG AS #A
              #A "trapclose [quit]"
              #A "font Times_New_Roman 10"

              #A.textresult "place 5 15 "
              #A.textresult "\";"No.of pieces"
              #A.textresult "\";"-----------------------------------------------------"
              #A.textresult "place 90 15 "
              #A.textresult "\";"Price "
              #A.textresult "place 180 15 "
              #A.textresult "\";"Total"

              #A.txtbox1 "40"
              #A.txtbox2, "60"
              #A.txtbox3, "77"
              #A.txtbox4, "65"
              #A.txtbox5, "33"
              #A.txtbox6, "87"
              #A.txtbox7, "22"
              #A.txtbox8, "94"
              #A.txtbox9, "122"
              #A.txtbox10, "111"

              #A.txtbox1 "!contents? OldTimes$"
              #A.txtbox6 "!contents? OldDistance$"
              #A.txtbox1 "!setfocus"
              timer 100, [CheckInput]
              wait

              [CheckInput]
              #A.txtbox1 "!contents? Times$"
              if Times$ <> OldTimes$ then
              #A.txtbox1 word$(Times$, 1)
              #A.txtbox2 word$(Times$, 2)
              #A.txtbox3 word$(Times$, 3)
              #A.txtbox4 word$(Times$, 4)
              #A.txtbox5 word$(Times$, 5)

              #A.txtbox1 "!contents? OldTimes$"
              end if
              #A.txtbox6 "!contents? Distance$"
              if Distance$ <> OldDistance$ then

              #A.txtbox6 word$(Distance$, 1)
              #A.txtbox7 word$(Distance$, 2)
              #A.txtbox8 word$(Distance$, 3)
              #A.txtbox9 word$(Distance$, 4)
              #A.txtbox10 word$(Distance$, 5)
              #A.txtbox6 "!contents? OldDistance$"
              end if
              wait
              [enter]
              PRINT #A.txtbox1, "!contents? a"
              PRINT #A.txtbox2, "!contents? b"
              PRINT #A.txtbox3, "!contents? c"
              PRINT #A.txtbox4, "!contents? d"
              PRINT #A.txtbox5, "!contents? e"
              PRINT #A.txtbox6, "!contents? f"
              PRINT #A.txtbox7, "!contents? g"
              PRINT #A.txtbox8, "!contents? h"
              PRINT #A.txtbox9, "!contents? i"
              PRINT #A.txtbox10, "!contents? j"
              #A.textresult "place 5 50"
              #A.textresult "\" ; a
              #A.textresult "place 5 70"
              #A.textresult "\" ; b
              #A.textresult "place 5 90"
              #A.textresult "\" ; c
              #A.textresult "place 5 110"
              #A.textresult "\" ; d
              #A.textresult "place 5 130"
              #A.textresult "\" ; e
              #A.textresult "place 100 50"
              #A.textresult "\" ; f
              #A.textresult "place 100 70"
              #A.textresult "\" ; g
              #A.textresult "place 100 90"
              #A.textresult "\" ; h
              #A.textresult "place 100 110"
              #A.textresult "\" ; i
              #A.textresult "place 100 130"
              #A.textresult "\" ; j
              #A.textresult "place 200 50"
              #A.textresult "\" ; a*f
              #A.textresult "place 200 70"
              #A.textresult "\" ; b*g
              #A.textresult "place 200 90"
              #A.textresult "\" ; c*h
              #A.textresult "place 200 110"
              #A.textresult "\" ; d*i
              #A.textresult "place 200 130"
              #A.textresult "\" ; e*j

              #A.textresult "flush"
              wait

              [Print]

              print #A.textresult, "print"'!!!!!!! only one line !!!!!!!
              wait
              [quit]
              TIMER 0
              CLOSE #A
              END
            Your message has been successfully submitted and would be delivered to recipients shortly.