How to display only 1 pixel from loaded image and tile it

Roaders

I am building a dashboard that allows me to manage 50+ separate projects. Each project has 3 - 5 Ci builds and I want to display the status of all these builds. I can load a build status badge for each job but I don't have anywhere near enough room to display 5 large badges.

What I want to do is take 1 pixel from this badge that will be either red, green or blue and then tile that one pixel to be a 10*10 pixel square so it's easy to see that all builds are green.

I think that I probably want to do this with css sprites but I've experimented a bit and can't get anywhere close to getting it to work.

Many thanks

Phablulo Joel

Have you tried to use CSS background-size property?

You could use the badge as a background image and make it so big that only one pixel will be visible on the tile.

.my-tile {
    width: 10px;
    height: 10px;
    background-image: url(YOUR BADGE URL) ;
    background-position: left top;
    background-size: 2000px 2000px; /* as big as you need */
} 

Also see this working example on fiddle: https://jsfiddle.net/549bxa6r/

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to Intent an image that loaded from the internet by glide

How to display only image from HTML

How to tile an image from center using UIColor patternImage in Swift

How to create an image pixel by pixel

How to read pixel values from image in Rust

How to get the coordinate of the loaded image and not the one from the display

How to get only 1 image from a video javascript

How to read pixel data only not meta data from 16 bit image in c#?

How to get Image pixel position loaded in QGraphicsView - Strange MapToScene() behaviour

How to create a grid of pixel coordinates from the corners of a MODIS tile?

how to display image in datebase with a tile

How to get the color of a pixel from image?

How do I display an image in JFrame from only a ByteArrayOutputStream?

How can I extract data from one pixel in an image and assign this data to another pixel in another image?

How to efficiently find and remove 1 pixel bands of image intensity changes?

How to move an image pixel by pixel?

Why display:table subtract 1 pixel from an image?

How to make 1 image tile in css?

How to check if an image has 2 bytes per pixel and how to convert it to an image with 1 byte per pixel?

Javascript - How to select an image loaded from an array

How to get pixel number from image by click?

How to generate an image from pixel values taken from a .csv file?

Python: how to display an image pixel by pixel using random coordinates

How to get a pixel color from Image, in Flutter?

Attempting to display image using pixel values in OpenCV. Only 1/3rd of Image shows

Apply CSS style only to the loaded image from`<picture>` element

How do I normalize the pixel value of an image to 0~1?

How can one do a pixel by pixel comparison of an image created by cairo and an image loaded from a file

Vue js: How to display list of components only when its required data is loaded from bakend?