Skip to content
Advertisement

Tag: image

HTML canvas image from rgb values

I have three 12×12 arrays, each with R, G and B values. How would I go about outputting the image (12×12) using HTML Canvas? I’ve come across Canvas demos that show drawing lines and whatnot, but nothing like providing some RGB arrays to produce something. Any guidance is greatly appreciated. Answer You can use the fillRect method, described here :

Lazy Loading HTML5 picture element

I have been searching (unsuccessfully) for a reliable method to lazy load images while using the HTML5 spec for <picture>. Most solutions/plugins out there currently rely on using data- attributes. I could be wrong, but it doesn’t seem this method will work in conjunction w/ <picture>. I’m really just looking to be pointed in the right direction. If anyone has

OnClick thumbnails – load image

I have a simple image gallery of about 25-30 photos with a thumbnails strip What i want is to load only the image that i click the thumbnail for not to wait until all the 25-30 photos are loaded because it slows down my website. Any ideas how to do that? Answer First, put all 25-30 photos on the page

How to convert a byte array into an image?

Using Javascript, I’m making an AJAX call to a WCF service, and it is returning a byte array. How can I convert that to an image and display it on the web page? Answer I realize this is an old thread, but I managed to do this through an AJAX call on a web service and thought I’d share… I

Get the Size of a CSS Background Image Using JavaScript?

Is it possible to use JavaScript to get the actual size (width and height in pixels) of a CSS referenced background image? Answer Yes, and I’d do it like this… Some notes… We need to remove the url() part that JavaScript returns to get the proper image source. We need to split on , in case the element has multiple

Advertisement