My God PhyrePhox, you are a programming machine. All you had to do is leave the icon to me and go party this weekend but nooooooooo...you just can't go and dance without beeing programming in your head and have to come back home asap to test it.
I haven't seen your icon yet (I don't want my chief to catch me playing with the camera instead of working) I'll try it in the evening. Here is mine:
The bar can certainly can be thinner, but it is good to have black lines and white as well so you can see it both in a light or in a dark background. It can be placed in the very edge of the screen.
I also made an SD card shape icon. 25 pixels wide so every level corresponds to 4% of the memory.
Dude, I log in here monday morning and there are 4 more pages in this thread. At least I'm not the only one been told by people to turn off the computer and get a life. This CHDK thing grows faster than any money-supported company project. Guys work 8 days a week for the joy of it!
P.S. No offence gentlemen, it's my monday rant ya know. Thanks for all your effort.
//BAR SHAPE
static void gui_space_draw_icon () {
coord x;
int perc = get_space_perc();
color cl = (GetFreeCardSpaceKb()/1024<=15)?conf.osd_color_warn:(conf.space_color&0xFF);
int h = 100; //indicator height (must be at least 6)
int w = 6; //indicator width (must be at least 6)
// memory icon
draw_rect(conf.space_icon_pos.x, conf.space_icon_pos.y, conf.space_icon_pos.x+h, conf.space_icon_pos.y+w, COLOR_BLACK);
draw_rect(conf.space_icon_pos.x+1, conf.space_icon_pos.y+1, conf.space_icon_pos.x+h-1, conf.space_icon_pos.y+w-1, COLOR_WHITE);
// memory fill
x=conf.space_icon_pos.x+(perc*h/100);
if (x<=conf.space_icon_pos.x) x=conf.space_icon_pos.x+1;
if (x>conf.space_icon_pos.x+h+1) x=conf.space_icon_pos.x+h+1;
draw_filled_rect(conf.space_icon_pos.x+2, conf.space_icon_pos.y+2, x-1, conf.space_icon_pos.y+w-2, MAKE_COLOR(COLOR_TRANSPARENT, COLOR_BLACK));
draw_filled_rect(x, conf.space_icon_pos.y+2, conf.space_icon_pos.x+h-2, conf.space_icon_pos.y+w-2, MAKE_COLOR(cl, cl));
}
//CARD SHAPE
static void gui_space_draw_icon () {
coord x;
int perc = get_space_perc();
color cl = (GetFreeCardSpaceKb()/1024<=15)?conf.osd_color_warn:(conf.space_color&0xFF);
int i;
// memory icon
draw_line(conf.space_icon_pos.x+5, conf.space_icon_pos.y, conf.space_icon_pos.x+27, conf.space_icon_pos.y, COLOR_BLACK); // top
draw_line(conf.space_icon_pos.x+6, conf.space_icon_pos.y+1, conf.space_icon_pos.x+26, conf.space_icon_pos.y+1, COLOR_WHITE); // top
draw_line(conf.space_icon_pos.x, conf.space_icon_pos.y+5, conf.space_icon_pos.x, conf.space_icon_pos.y+18, COLOR_BLACK); // left
draw_line(conf.space_icon_pos.x+1, conf.space_icon_pos.y+6, conf.space_icon_pos.x+1, conf.space_icon_pos.y+17, COLOR_WHITE); // left
draw_line(conf.space_icon_pos.x, conf.space_icon_pos.y+18, conf.space_icon_pos.x+27, conf.space_icon_pos.y+18, COLOR_BLACK); // bottom
draw_line(conf.space_icon_pos.x+1, conf.space_icon_pos.y+17, conf.space_icon_pos.x+26, conf.space_icon_pos.y+17, COLOR_WHITE); // bottom
draw_line(conf.space_icon_pos.x+27, conf.space_icon_pos.y, conf.space_icon_pos.x+27, conf.space_icon_pos.y+18, COLOR_BLACK); // right
draw_line(conf.space_icon_pos.x+26, conf.space_icon_pos.y+1, conf.space_icon_pos.x+26, conf.space_icon_pos.y+17, COLOR_WHITE); // right
draw_line(conf.space_icon_pos.x+5, conf.space_icon_pos.y, conf.space_icon_pos.x, conf.space_icon_pos.y+5, COLOR_BLACK); // edge
draw_line(conf.space_icon_pos.x+5, conf.space_icon_pos.y+1, conf.space_icon_pos.x+1, conf.space_icon_pos.y+5, COLOR_WHITE); // edge
draw_line(conf.space_icon_pos.x+6, conf.space_icon_pos.y+1, conf.space_icon_pos.x+1, conf.space_icon_pos.y+6, COLOR_WHITE); // edge
// memory fill
x=2+(perc*24/100);
if (x>5) draw_line(conf.space_icon_pos.x+6, conf.space_icon_pos.y+2, conf.space_icon_pos.x+x, conf.space_icon_pos.y+2, COLOR_BLACK);
if (x>2) draw_line(conf.space_icon_pos.x+x+1, conf.space_icon_pos.y+2, conf.space_icon_pos.x+25, conf.space_icon_pos.y+2, COLOR_WHITE);
else draw_line(conf.space_icon_pos.x+4, conf.space_icon_pos.y+2, conf.space_icon_pos.x+25, conf.space_icon_pos.y+2, COLOR_WHITE);
for(i=3;i<7;i++){
if (x>7-i) draw_pixel(conf.space_icon_pos.x+8-i, conf.space_icon_pos.y+i, COLOR_BLACK);
if (x>7-i) draw_pixel(conf.space_icon_pos.x+x, conf.space_icon_pos.y+i, COLOR_BLACK);
draw_line(conf.space_icon_pos.x+x+1, conf.space_icon_pos.y+i, conf.space_icon_pos.x+25, conf.space_icon_pos.y+i, COLOR_WHITE);
}
for(i=7;i<16;i++){
if (x>1) draw_pixel(conf.space_icon_pos.x+2, conf.space_icon_pos.y+i, COLOR_BLACK);
if (x>1) draw_pixel(conf.space_icon_pos.x+x, conf.space_icon_pos.y+i, COLOR_BLACK);
draw_line(conf.space_icon_pos.x+x+1, conf.space_icon_pos.y+i, conf.space_icon_pos.x+25, conf.space_icon_pos.y+i, COLOR_WHITE);
}
if (x>1) draw_line(conf.space_icon_pos.x+2, conf.space_icon_pos.y+16, conf.space_icon_pos.x+x, conf.space_icon_pos.y+16, COLOR_BLACK);
draw_line(conf.space_icon_pos.x+x+1, conf.space_icon_pos.y+16, conf.space_icon_pos.x+25, conf.space_icon_pos.y+16, COLOR_WHITE);
}