--[[@title Selftimer ICO@param g Selftimer (sec) @default g 10 @range g 0 60@param f Start Msg Time (sec) @default f 5 @range f 0 60--]]require("drawings")function s_ico() -- Selftimer ICO + # sec if ( g > 9 ) then xs=174 else xs=188 end for i=0,(f*10),1 do draw_rect( 138, 93, 222, 147, 258,2) draw_rect_filled( 140, 95, 220, 145, 257, 257) draw_ellipse( 180, 120, 23, 23, 258) draw_ellipse( 180, 120, 22, 22, 258) draw_ellipse( 180, 120, 21, 21, 258) draw_rect_filled( 155, 95, 166, 110, 257, 257) draw_string( 172, 95, "'", 258, 257,2,2) draw_string( xs, 114, g, 258, 257,2,2) draw_line( 164, 107, 177, 118, 258) draw_line( 164, 107, 176, 118, 258) draw_line( 164, 107, 175, 118, 258) draw_line( 164, 107, 174, 118, 258) draw.overdraw() sleep(100) end draw.clear()endfunction ellipse() -- circle draw_ellipse_filled( 35, 35, 28, 28, 258) draw_ellipse_filled( 35, 35, 23, 23, 256)endfunction blink() -- blinking # sec for i=0, g,1 do if ( (g-i) > 9 ) then xn=20 else xn=28 end set_led(4,1) ellipse() draw_rect_filled( 0, 0, 35, 35, 256, 256) draw_string( xn, 22, (g-i), 258, 256, 2, 2) sleep(250) set_led(4,0) ellipse() draw_rect_filled( 35, 0, 64, 35, 256, 256) draw_string( xn, 22, (g-i), 258, 256, 2, 2) sleep(250) set_led(4,1) ellipse() draw_rect_filled( 35, 35, 64, 64, 256, 256) draw_string( xn, 22, (g-i), 258, 256, 2, 2) sleep(250) set_led(4,0) ellipse() draw_rect_filled( 0, 35, 35, 64, 256, 256) draw_string( xn, 22, (g-i), 258, 256, 2, 2) sleep(250) draw_clear() endendfunction half_press() press("shoot_half") while(is_pressed("shoot_half")) do sleep(20) end release("shoot_half") end function full_press() if( g > 0) then blink() end press("shoot_full") while(is_pressed("shoot_full")) do sleep(20) end release("shoot_full") end ------------------------------------------------------------------- set_exit_key("no_key") set_draw_title_line(0) if( g > 0) then s_ico() end repeat repeat wait_click(1000) until not(is_key("no_key")) if (is_key("shoot_full")) then full_press() elseif (is_key("shoot_half")) then half_press() elseif ( is_key("zoom_in")) then press("zoom_in") while(is_pressed("zoom_in")) do sleep(20) end release("zoom_in") elseif ( is_key("zoom_out")) then press("zoom_out") while(is_pressed("zoom_out")) do sleep(20) end release("zoom_out") end until ( is_key("menu") )
Just a useless mini lua script to test CHDK "graphic" features (...not too many, sadly)
I was wondering if we could get a draw.add("image") for a WYSIWYG script/menu interface.
I was thinking to something like this (8 mini b/w custom bitmaps). Too memory/processing time ??
You might want to review this conversation :http://chdk.setepontos.com/index.php?topic=8151.msg85905#msg85905I don't think it reached a definite conclusion but it did cover some of the same ground.
Started by joey.enfield General Discussion and Assistance
Started by flarn2006 Feature Requests
Started by frank Feature Requests
Started by outslider « 1 2 3 4 » General Discussion and Assistance
Started by otosclerosi « 1 2 3 » LUA Scripting