Convert monochrome bitmap to ascii string to send to QLS-printer?
-
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!
-
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!
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.
-
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.
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.
-
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.
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.
-
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.
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 -
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 KreskowiakA 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?!
-
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?!
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 -
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 KreskowiakAlright, I'll have to get more basic facts about the printer first then?! Thanks anyway.