Image file to txt for dot matrix print [closed]
up vote
-1
down vote
favorite
help, who understands dot matrix print ...
I have a signature file, now the user wants the print result to have a signature. I am confused how to put the signature image file to * .txt om. there is a solution?
javascript php dot-matrix
New contributor
closed as unclear what you're asking by Quentin, Graham, pirho, Alexei, EdChum Nov 10 at 16:53
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-1
down vote
favorite
help, who understands dot matrix print ...
I have a signature file, now the user wants the print result to have a signature. I am confused how to put the signature image file to * .txt om. there is a solution?
javascript php dot-matrix
New contributor
closed as unclear what you're asking by Quentin, Graham, pirho, Alexei, EdChum Nov 10 at 16:53
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.
– Quentin
Nov 10 at 14:35
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
help, who understands dot matrix print ...
I have a signature file, now the user wants the print result to have a signature. I am confused how to put the signature image file to * .txt om. there is a solution?
javascript php dot-matrix
New contributor
help, who understands dot matrix print ...
I have a signature file, now the user wants the print result to have a signature. I am confused how to put the signature image file to * .txt om. there is a solution?
javascript php dot-matrix
javascript php dot-matrix
New contributor
New contributor
New contributor
asked Nov 10 at 14:11
Irvan Indriyan
1
1
New contributor
New contributor
closed as unclear what you're asking by Quentin, Graham, pirho, Alexei, EdChum Nov 10 at 16:53
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Quentin, Graham, pirho, Alexei, EdChum Nov 10 at 16:53
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.
– Quentin
Nov 10 at 14:35
add a comment |
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.
– Quentin
Nov 10 at 14:35
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this
.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.– Quentin
Nov 10 at 14:35
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this
.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.– Quentin
Nov 10 at 14:35
add a comment |
1 Answer
1
active
oldest
votes
up vote
-1
down vote
The technique is to write a canvas element using the image:
In order to do it, you need:
- create the canvas with width and height that are equal to image's width and height
- draw the image into it
const image = document.getElementById('yourImage');
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = myImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
Now you can get the array as you wanted.
any element in array is RGBA.
const imageData = ctx.getImageData(0, 0, image.width, image.height);
Note: The image needs to be on same domain!
Otherwise, you can't do it (no matter if it's public on the internet).
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
-1
down vote
The technique is to write a canvas element using the image:
In order to do it, you need:
- create the canvas with width and height that are equal to image's width and height
- draw the image into it
const image = document.getElementById('yourImage');
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = myImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
Now you can get the array as you wanted.
any element in array is RGBA.
const imageData = ctx.getImageData(0, 0, image.width, image.height);
Note: The image needs to be on same domain!
Otherwise, you can't do it (no matter if it's public on the internet).
add a comment |
up vote
-1
down vote
The technique is to write a canvas element using the image:
In order to do it, you need:
- create the canvas with width and height that are equal to image's width and height
- draw the image into it
const image = document.getElementById('yourImage');
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = myImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
Now you can get the array as you wanted.
any element in array is RGBA.
const imageData = ctx.getImageData(0, 0, image.width, image.height);
Note: The image needs to be on same domain!
Otherwise, you can't do it (no matter if it's public on the internet).
add a comment |
up vote
-1
down vote
up vote
-1
down vote
The technique is to write a canvas element using the image:
In order to do it, you need:
- create the canvas with width and height that are equal to image's width and height
- draw the image into it
const image = document.getElementById('yourImage');
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = myImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
Now you can get the array as you wanted.
any element in array is RGBA.
const imageData = ctx.getImageData(0, 0, image.width, image.height);
Note: The image needs to be on same domain!
Otherwise, you can't do it (no matter if it's public on the internet).
The technique is to write a canvas element using the image:
In order to do it, you need:
- create the canvas with width and height that are equal to image's width and height
- draw the image into it
const image = document.getElementById('yourImage');
const canvas = document.createElement('canvas');
canvas.width = image.width;
canvas.height = myImage.height;
const ctx = canvas.getContext('2d');
ctx.drawImage(image, 0, 0);
Now you can get the array as you wanted.
any element in array is RGBA.
const imageData = ctx.getImageData(0, 0, image.width, image.height);
Note: The image needs to be on same domain!
Otherwise, you can't do it (no matter if it's public on the internet).
answered Nov 10 at 14:28
Alon Shmiel
1,0621565113
1,0621565113
add a comment |
add a comment |
Your question is very unclear. What does JavaScript have to do with this? What does PHP have to do with this? What is "a signature file"? Is it a text file containing a standard sign off message as you might configure your email client to use? Is it a bitmap image of the type of signature someone would sign with a pen at the bottom of a letter? What is this
.txt
file that you want to add it to? Where does this "dot matrix print" come into it? Is this about printing to an old low-res hard copy printer? From JS or PHP or something else? You should probably show some code to provide context.– Quentin
Nov 10 at 14:35