View Single Post
Old 09-04-2015, 07:14 AM   #34
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by knc1 View Post
Works for me.
How are you trying to use it?
A copy and paste?

http://java-gnome.sourceforge.net/do...gInExposeEvent
I hope this link starts to work from everywhere in the world.

Because not the linked to, next to last, example but the following, last, example is probably more of interest.
Code at: http://java-gnome.sourceforge.net/do...inedPaper.html

There you'll see how the doodle of a tank (as a png) is overlayed on what is already written on the surface.

K2 devices don't have a lot of processing power, but for a clock, we can use pre-rendered textual parts (not unlike what matchbox-keyboard does for its keycaps).
See: loading-images.lua in the cairo archive above, examples directory.

We would need (rendered in desired font, saved as *.png files):
A 12 item array of month names -
A 7 item array of day names -
A 2 item array of day part name (AM, PM) -
A 10 element array of (properly kerned) digits -
A colon -
Ah, I think that is all that might be found on a clock face.
Oh, maybe a rendered background pattern.

clocktab site uses a table to align the parts -
We could use a pre-computed table (the only datatype that Lua has) of component coordinates -
call 'date' with a custom (easy to read) format string -
read the parts of the string -
lookup that part's coordinates and png -
read to pix buffer, set as those coordinates -
write the whole thing to a *.png in /tmp -
make an eps call to display the png -
go back to sleep.

I am thinking that even a K2 could do that every minute.

Last edited by knc1; 09-04-2015 at 07:29 AM.
knc1 is offline   Reply With Quote