Some notes: desired result (for PNG): not fact 1 fact 2 facts 3 Fact 4 ...
a) not the whole page,
b) not from server side
For example, C) sung or "treated" HTML,
fact 1 fact 2 fact 3 fact 4 ...
& lt; Code & gt; "Sign" nbsp; & Lt; / Code & gt; Can be used to make white space but it is necessary to render it again.
Most likely some javascript which acts as a URA (browser) for getting the first data provided and then converts it to BMP format which supports PNG ... key Kind? The code sample will be highly appreciated.
Many thanks.
What is wrong with generating this server-side?
Edit: What's wrong with using just html + css? For the user it looks the same, prints the same and it is fast, searchable and accessible and you can easily manipulate it with javascript. I am unable to see why you want the images in the first place.
The short answer to this question is the same: No, you can not. The problems that you need to overcome include, but are not limited to:
-
You have to correctly submit HTML to a bitmap, it seems that It is infinitely more difficult
-
Reducing the image using PNG is not trivial, and whenever it is technically possible to do this with JS, then definitely From this it is a very bad idea.
Even if you somehow manage these problems around, you have hacky and extremely brittle code which is almost cross-working for the browser There will be no chance to end up with.
Doing this will require some concrete and to develop the Moon's rock to use the moon's dust, it must be developed instead of buying something in Home Depot.
- ceejayoz, on topic
However (SVG, canvas, server side generation, ...) you might want to see .
Edit 2: Directly loaded images from HTML files
I used PHP for base 64_encode for those images Here's the source:
& lt; Script type = "text / javascript" & gt; Var i = 0; Var imgs = []; & Lt ;? Php $ imgArray = array ('angry.gif', 'pray.gif', 'think.gif'); $ Imgs = array_map (function ($ d) {return base64_encode (file_get_contents ($ d))}}, $ imgArray); $ I = =; Forex Currency ($ img $ as img) {echo 'imgs [' $ i ++ '] = "'. $ Img." \ "; \ N"; }? & Gt; Function changeImg () {i = (i + 1)% imgs.length; Var img = document.getElementById ('Image '); Img.src = 'Data: Image / GIF; Base 64, '+ IMGS [I] ;; } & Lt; / Script & gt; & Lt; Body onload = "changeImg ()" & gt; & Lt; Input type = "button" onclick = "changeImg ();" Value = "Change image" /> gt; & Lt; Br / & gt; & Lt; Br / & gt; & Lt; Img src = "" id = "theImage" alt = "" />
Comments
Post a Comment