Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Convert monochrome bitmap to ascii string to send to QLS-printer?

Convert monochrome bitmap to ascii string to send to QLS-printer?

Scheduled Pinned Locked Moved C#
graphicshelptutorialquestion
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mats Euren
    wrote on last edited by
    #1

    Hi everyone. I´m on the hunt for some good code examples on how to convert a bitmap file (In my case a monochrome bitmap) to an ASCII string. This ASCII string will be sent to a QLS-printer to be printed. There must be someone who has run in to the same problem as myself, would anyone like to share his/her experience? Thanks!

    L 1 Reply Last reply
    0
    • M Mats Euren

      Hi everyone. I´m on the hunt for some good code examples on how to convert a bitmap file (In my case a monochrome bitmap) to an ASCII string. This ASCII string will be sent to a QLS-printer to be printed. There must be someone who has run in to the same problem as myself, would anyone like to share his/her experience? Thanks!

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      Don't you have the driver that goes with your printer? Try this[^]. BTW: I fail to see how an image would need to be converted into an ASCII string. And what would you do if you had such string? It would print as text anyway. :)

      Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

      Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

      M 1 Reply Last reply
      0
      • L Luc Pattyn

        Don't you have the driver that goes with your printer? Try this[^]. BTW: I fail to see how an image would need to be converted into an ASCII string. And what would you do if you had such string? It would print as text anyway. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        M Offline
        M Offline
        Mats Euren
        wrote on last edited by
        #3

        I actually don't have access to the printer at the moment to be able to test and the thing is that the printer can handle either the .PCX file format or ASCII format. According to the project specifications I must convert the .BMP-file I have to ASCII.

        L D 2 Replies Last reply
        0
        • M Mats Euren

          I actually don't have access to the printer at the moment to be able to test and the thing is that the printer can handle either the .PCX file format or ASCII format. According to the project specifications I must convert the .BMP-file I have to ASCII.

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          Then you should hunt for the printer's documentation. Although I still think getting the proper driver is the right way to go. :)

          Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

          Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

          1 Reply Last reply
          0
          • M Mats Euren

            I actually don't have access to the printer at the moment to be able to test and the thing is that the printer can handle either the .PCX file format or ASCII format. According to the project specifications I must convert the .BMP-file I have to ASCII.

            D Offline
            D Offline
            Dave Kreskowiak
            wrote on last edited by
            #5

            ASCII is text. So define how this image is supposed to be "converted to ASCII". Are you talking about "ASCII art"? Are you saying that the printer understands some bitmap format and the image has to be converted into a string of commands that the printer understands in order to printer the image?

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak

            M 1 Reply Last reply
            0
            • D Dave Kreskowiak

              ASCII is text. So define how this image is supposed to be "converted to ASCII". Are you talking about "ASCII art"? Are you saying that the printer understands some bitmap format and the image has to be converted into a string of commands that the printer understands in order to printer the image?

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak

              M Offline
              M Offline
              Mats Euren
              wrote on last edited by
              #6

              A bitmap consist of a header telling wich color depth it has how large it is and the data describing the image etc, etc. This is what is supposed to be sent to the printer coverted to ASCII characters. I'm not talking about ASCII art, and it is not "commands" which tells the printer what to do, it is just plain data that the printer interprets as an image. At the moment I haven't got the actual printer model and hence no manual. I thougth that this was a common problem for which there are quite a few solutions to?!

              D 1 Reply Last reply
              0
              • M Mats Euren

                A bitmap consist of a header telling wich color depth it has how large it is and the data describing the image etc, etc. This is what is supposed to be sent to the printer coverted to ASCII characters. I'm not talking about ASCII art, and it is not "commands" which tells the printer what to do, it is just plain data that the printer interprets as an image. At the moment I haven't got the actual printer model and hence no manual. I thougth that this was a common problem for which there are quite a few solutions to?!

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Mats Eurén wrote:

                and it is not "commands" which tells the printer what to do, it is just plain data that the printer interprets as an image.

                How do you think the printer knows what's an image and what isn't?? You have to format the data with the correct COMMAND CODES, which as specific to each printer, to tell it that the data that's coming is an image and how to render it. But, without the manual/documentation on the command codes the printer understands, you'll find it impossible to do this.

                Mats Eurén wrote:

                I thougth that this was a common problem for which there are quite a few solutions to?!

                No, actually, that is a very old method of getting the printer to print an image. Today, it's done through printer drivers that handle images automatically. You basically draw the image to a drawing surface that represents the page, then the printer driver converts that image into a stream of command codes and data that the printer understands.

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak

                M 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Mats Eurén wrote:

                  and it is not "commands" which tells the printer what to do, it is just plain data that the printer interprets as an image.

                  How do you think the printer knows what's an image and what isn't?? You have to format the data with the correct COMMAND CODES, which as specific to each printer, to tell it that the data that's coming is an image and how to render it. But, without the manual/documentation on the command codes the printer understands, you'll find it impossible to do this.

                  Mats Eurén wrote:

                  I thougth that this was a common problem for which there are quite a few solutions to?!

                  No, actually, that is a very old method of getting the printer to print an image. Today, it's done through printer drivers that handle images automatically. You basically draw the image to a drawing surface that represents the page, then the printer driver converts that image into a stream of command codes and data that the printer understands.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak

                  M Offline
                  M Offline
                  Mats Euren
                  wrote on last edited by
                  #8

                  Alright, I'll have to get more basic facts about the printer first then?! Thanks anyway.

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups