Bitmap on button

Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Bitmap on button

Postby Graeme » Mon Mar 04, 2013 9:01 am

Hi,

I have over the weekend modified the createbutton function to take two extra arguments i.e. a bitmap for "button pushed" and a bitmap for "button released". The new function also uses the size of the bitmap(square) to determine the touch area. Works really nicely and looks great although my additions are a bit of a hack. The buttons can be designed in any bitmap editor (gimp/corel /paint etc) with shading etc.

Does something like this already exist in the source? Had a quick look but couldn't see anything.

I use ST Embedded GUI tool to convert the images to the correct 565 format(in a C array) as as far as I know gimp only generates 24-bit arrays (might be wrong here) .

Cheers
Graeme

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Bitmap on button

Postby Tectu » Mon Mar 04, 2013 10:55 am

Hello Graeme,

This sounds like a VERY useful feature. I would appreciate to see it in the main ChibiOS/GFX source code :)
You could create a pull request and I'll simply clean up your code - if needed. If you don't know how to use git stuff, you can also mail me your source changes. I'll embed them into the repo then.

It would be also nice if you could write just a few lines to show how to exactly use the new feature (Which GIMP settings are required to convert the picture, how to link the source file and how to call the button routine). I'd then put that on the website.

Well done!


~ Tectu

Graeme
Posts: 13
Joined: Fri Mar 01, 2013 10:26 am

Re: Bitmap on button

Postby Graeme » Mon Mar 04, 2013 11:10 am

Hi Tectu,

Thanks.

Sure. Will have to mail it to you as I am clueless on git stuff. Will send it this evening as I don't have the source with me at work.

Graeme

User avatar
Tectu
Posts: 1226
Joined: Thu May 10, 2012 9:50 am
Location: Switzerland
Contact:

Re: Bitmap on button

Postby Tectu » Mon Mar 04, 2013 11:21 am

That sounds right. My mail can be found here (bottom of the page). Sorry, I don't like to write mail's down in public forums, too much spam crawlers :D


~ Tectu


Return to “LCD Driver and Graphic Framework”

Who is online

Users browsing this forum: No registered users and 30 guests