Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yboujraf opened this issue Dec 30, 2019 · 2 comments

Comments

@yboujraf
Copy link

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

@jhuckaby
Copy link
Owner

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!

@yboujraf
Copy link
Author

Dear @jhuckaby

Thanks for the share.

I did it and I cross my fingers.

Best Regards
Youssef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants