canvas-plus icon indicating copy to clipboard operation
canvas-plus copied to clipboard

Bitmap - generating on the fly in nodejs javascript - bitmap 64x32 with 1 till 4 lines with autosize

Open yboujraf opened this issue 6 years ago • 2 comments

Dear @jhuckaby

I hope you are very well in this moment and my best wishes for 2020, health and $$$$ ;-)

I am back to you regarding your repository. Nice job.

I am controlling some bitmap push button and need to generate on the fly a bitmap array each time a value parameter changed.

Bitmap structure of the push button is :

image

Size 64x32 Color 1 bit (Black : 0xFF, white : 0x00) pixels are on top right corner. And if you see the picture above, I need to reverse the bits.

Use case 1 . generating bitmap array of byte (here 256 bytes) with 1 till 4 lines

  • with possible auto size, position (x,y) ,wrap, space between lines, ... and be possible to invert for each line separately the background .

Use case 2 : generating bitmap array from a picture loaded from file bmp, png, jpeg, ... and generate the bitmap array as specified above with resige to 64x32 if possible keeping aspect ratio.

I appreciate if you could help me for this purpose or route me to to the correct way.

My Best Wishses for your family and enjoy live Youssef

yboujraf avatar Dec 30 '19 13:12 yboujraf

Hello there. I'm very sorry, but what you are asking is entirely beyond the capabilities of this library. CanvasPlus is merely a wrapper around the HTML5 Canvas object, adding some high-level features. What you need, I think, is a low-level image library that gives you access to the raw bytes. Maybe try something like Sharp?

Good luck, and sorry!

jhuckaby avatar Dec 30 '19 17:12 jhuckaby

Dear @jhuckaby

Thanks for the share.

I did it and I cross my fingers.

Best Regards Youssef

yboujraf avatar Dec 30 '19 20:12 yboujraf