|
Post by alexfish on Jan 6, 2015 2:35:11 GMT 1
Must be like me anyway will have to adapt to suit , it will be easy to set the property as an include to main file depend on version this is what the general scheme will possible look like. all much the same as hug. in the coding and syntax scheme... pleased to see back of RECORD for storing data , up to now ..fingers crossed as mentioned will have to adapt the properties to suit , maybe add own bits for testing... Have Fun + BR ,, and missed one post + Happy New Year to U. Alex PRAGMA LDFLAGS `pkg-config --libs elementary ` PRAGMA OPTIONS `pkg-config --cflags elementary ` PRAGMA INCLUDE elementary-1/Elementary.h
PROTO elm_init , elm_policy_set ,evas_object_show ,elm_run ,elm_shutdown,elm_exit PROTO evas_object_evas_get PROTO elm_win_util_standard_add , elm_win_autodel_set evas_object_resize ,elm_win_title_set PROTO elm_win_add ,elm_win_title_set ,elm_win_title_get elm_win_autodel_set PROTO elm_win_inwin_activate PROTO evas_object_size_hint_weight_set ,evas_object_size_hint_align_set PROTO elm_object_part_text_set , elm_object_text_set , evas_object_move ,evas_object_smart_callback_add PROTO elm_win_center PROTO elm_win_modal_set PROTO elm_win_borderless_set PROTO elm_win_fullscreen_set PROTO elm_win_maximized_set PROTO elm_win_alpha_set PROTO elm_win_withdrawn_set PROTO elm_win_iconified_set PROTO elm_win_rotation_set PROTO elm_win_icon_object_set PROTO elm_object_scale_set PROTO elm_object_item_text_get PROTO elm_win_icon_object_set PROTO elm_button_add,evas_object_resize,evas_object_show PROTO elm_policy_set,elm_win_util_standard_add,elm_win_autodel_set,evas_object_resize
DECLARE hug_widget_counter TYPE NUMBER
DECLARE *win , *but TYPE Evas_Object DECLARE hug_widget_window_widget ASSOC NUMBER
DECLARE hug_widget_xsize ASSOC NUMBER DECLARE hug_widget_ysize ASSOC NUMBER DECLARE hug_widget_signal ASSOC NUMBER DECLARE hug_widget_s_widget ASSOC NUMBER
DECLARE hug_winstate ASSOC NUMBER DECLARE hug_canvas_expose ASSOC NUMBER DECLARE hug_widget_type$ ASSOC STRING DECLARE hug_widget_caption$ ASSOC STRING DECLARE hug_widget_attach ASSOC NUMBER DECLARE hug_widget_font ASSOC NUMBER DECLARE hug_widget_focus ASSOC NUMBER
REM --------------------------------------------------
FUNCTION WINDOW(STRING hug_title$, int hug_xsize, int hug_ysize)
INCR hug_widget_counter
LOCAL x, y TYPE int LOCAL *window TYPE Evas_Object LOCAL my_id TYPE long*
elm_policy_set(ELM_POLICY_QUIT,ELM_POLICY_QUIT_LAST_WINDOW_CLOSED) window = elm_win_util_standard_add(hug_title$,hug_title$) elm_win_autodel_set(window,TRUE) elm_policy_set(0,1) evas_object_resize(window, hug_xsize, hug_ysize)
IF window THEN PRINT "Win" ELSE PRINT "loose" END IF
evas_object_show(window)
hug_widget_s_widget(STR$(hug_widget_counter))=(long)(long*)window
RETURN hug_widget_counter
END FUNCTION
REM --------------------------------------------------
SUB SETPROPERTY (NUMBER widget,...)
PROTO va_list , va_start, va_end , va_arg PROTO elm_object_tooltip_text_set, elm_object_part_text_set, elm_object_tooltip_text_set PROTO elm_object_tooltip_orient_set,elm_icon_standard_set,elm_object_part_content_set
LOCAL var_args TYPE va_list LOCAL *first_property TYPE char LOCAL *second_property TYPE char LOCAL myval TYPE int LOCAL *Hug_widget_id TYPE Evas_Object
Hug_widget_id=(Evas_Object*)hug_widget_s_widget(STR$(widget)) va_start (var_args, widget)
REPEAT
first_property = va_arg (var_args, char*)
IF EQUAL("label",first_property) THEN first_property = va_arg (var_args, char*) PRINT " texting label: " PRINT first_property elm_object_part_text_set(Hug_widget_id,"default",first_property) END IF
IF EQUAL("tool-tip",first_property) THEN first_property = va_arg (var_args, char*) PRINT " tool tip label: " PRINT first_property elm_object_tooltip_text_set(Hug_widget_id,first_property) END IF
IF EQUAL("tool-tip-orient",first_property) THEN LOCAL orient TYPE int orient = va_arg (var_args, int) PRINT " tool-tip-orient: " elm_object_tooltip_orient_set(Hug_widget_id,orient) END IF
IF EQUAL("icon-standard",first_property) THEN first_property = va_arg (var_args, char*) PRINT first_property LOCAL *icon , *win_id TYPE Evas_Object LOCAL get_win TYPE long
get_win = va_arg (var_args, long) win_id=(Evas_Object*)hug_widget_s_widget(STR$(get_win)) icon = elm_icon_add(win_id) elm_icon_standard_set(icon,first_property) elm_object_part_content_set(Hug_widget_id, "icon", icon) END IF
UNTIL first_property = NULL
va_end (var_args)
END SUB
REM --------------------------------------------------
SUB ATTACH(NUMBER hug_widget, NUMBER hug_child, NUMBER hug_xpos, NUMBER hug_ypos) LOCAL *widget , *window_id TYPE Evas_Object window_id=(Evas_Object*)hug_widget_s_widget(STR$(hug_widget)) SELECT hug_widget_type$(STR$(hug_child)) CASE "button" PRINT "Button" widget=elm_button_add(window_id) evas_object_move(widget,hug_xpos,hug_ypos) evas_object_resize(widget,hug_widget_xsize(STR$(hug_child)),hug_widget_ysize(STR$(hug_child))) elm_object_part_text_set(widget,NULL,hug_widget_caption$(STR$(hug_child))) evas_object_show(widget) hug_widget_s_widget(STR$(hug_child))=(long)(long*)widget END SELECT END SUB
REM --------------------------------------------------
FUNCTION BUTTON(STRING hug_title$, int hug_xsize, int hug_ysize) INCR hug_widget_counter hug_widget_xsize(STR$(hug_widget_counter)) = hug_xsize hug_widget_ysize(STR$(hug_widget_counter)) = hug_ysize hug_widget_signal(STR$(hug_widget_counter)) = 2 hug_widget_caption$(STR$(hug_widget_counter))=hug_title$ hug_widget_s_widget(STR$(hug_widget_counter)) = hug_widget_counter
hug_widget_type$(STR$(hug_widget_counter)) = "button" hug_widget_attach(STR$(hug_widget_counter)) = hug_widget_counter hug_widget_font(STR$(hug_widget_counter)) = hug_widget_counter hug_widget_focus(STR$(hug_widget_counter)) = hug_widget_counter
RETURN hug_widget_counter
END FUNCTION
REM --- Main ------------------------- IF elm_init(0,0) THEN PRINT "elm init" ELSE PRINT "Init fail"
END IF window = WINDOW("Test",600,400)
button_1=BUTTON("This is a Button",120,30) ATTACH(window,button_1,5,5) SETPROPERTY(button_1,"label","button text","tool-tip","Click Me","tool-tip-orient",ELM_TOOLTIP_ORIENT_RIGHT,"icon-standard","home",window,NULL) elm_run elm_shutdown
REM end all that
Time for Zzzzzzzzzzzzzzzzzzzzzzzzzzzz
|
|
|
Post by vovchik on Jan 6, 2015 11:05:45 GMT 1
Dear Alex, It's starting to look a lot like HUG. Nice. While the "elm_object_tooltip_orient_set" doesn't work for me, I have an alphabetized list of those PROTOs in main: PROTO elm_button_add PROTO elm_exit PROTO elm_init PROTO elm_object_item_text_get PROTO elm_object_part_text_set PROTO elm_object_scale_set PROTO elm_object_text_set PROTO elm_object_tooltip_orient_set PROTO elm_policy_set PROTO elm_run PROTO elm_shutdown PROTO elm_win_add PROTO elm_win_alpha_set PROTO elm_win_autodel_set PROTO elm_win_autodel_set evas_object_resize PROTO elm_win_borderless_set PROTO elm_win_center PROTO elm_win_fullscreen_set PROTO elm_win_iconified_set PROTO elm_win_icon_object_set PROTO elm_win_inwin_activate PROTO elm_win_maximized_set PROTO elm_win_modal_set PROTO elm_win_rotation_set PROTO elm_win_title_get elm_win_autodel_set PROTO elm_win_title_set PROTO elm_win_util_standard_add PROTO elm_win_withdrawn_set PROTO evas_object_evas_get PROTO evas_object_move PROTO evas_object_resize PROTO evas_object_show PROTO evas_object_size_hint_align_set PROTO evas_object_size_hint_weight_set PROTO evas_object_smart_callback_add
I found a few duplicates and got rid of them, just for form's sake... With kind regards, vovchik
|
|
|
Post by alexfish on Jan 6, 2015 23:47:03 GMT 1
Hi Vovchik
more or less at full circle with the new scheme , now well on more or less a coppy and paste of original lib then apply the mods..
had to make changes to the canvas objects RE colors , hug draws direct to the canvas , so implemented similar
because of the alpha channel have implemented GCOL scheme IE Set the colors the draw the object as say SQUARE,
the SETPROPERTY is now functioning without the need for null since the FUNCTION changed to e_object_set therefore redirected by Macro DEF FN
DEF FN SETPROPERTY(arg1,...) = e_object_set(arg1,__VA_ARGS__,NULL)
will update the lib when complete / initial lib will probable = 1.7 , with option for includes e_object_set *version up to 1.11 or 1.12 IE 1.7 : 1.8 : 1.9 : then new 1.11.* :
can not recommend 1.11.* there are issues with child & in-windows. as regards 1.9 now going to recheck with a reinstall , to see if svg problems still exist.
as far as user is concerned t: these are the basics.
REM demo- new scheme.
SUB Clicked()
HIDE(button_1)
END SUB
REM --- Main -------------------------
IF INIT THEN PRINT "elm init" ELSE PRINT "Init fail" END 1 END IF
HUGOPTIONS("CANVAS EVAS") window = WINDOW("Test",600,400) canvas = CANVAS(window,600,400) GCOL(255,0,214,255) SQUARE(canvas,100,100,100,50)
button_1=BUTTON("This is a Button",120,30) ATTACH(window,button_1,5,5) SETPROPERTY(button_1,"label","button text","tool-tip","Click Me","tool-tip-orient",ELM_TOOLTIP_ORIENT_RIGHT,"icon-standard","home",window) CALLBACK(button_1,Clicked)
DISPLAY
REM end all that
|
|
|
Post by vovchik on Jan 7, 2015 1:07:18 GMT 1
Dear Alex, I seem to recall that you had problems using IM's svg to png convert. Turns out that need that rsvg bin stuff (separate package via apt-get) in addition to the rsvg lib and headers. I wonder whether the same isn't true of enlightenment. It is just a thought. And good thing you have preserved all the alpha color stuff. I recall we had problems saving the graphics canvas after making changes - the on-screen stuff did not commit to the save buffer in my old tile demos. Any light you can throw on that now? That would be a nice thing to solve and to be able to use elm's equivalent to gdk_pixbuf. I haven't found any solution yet, altough I managed to feed a gdk pixbuf to elm and it did show something. Must be something relating to bit depth, alpha, row and stride as they are stored in memory. With kind regards, vovchik
|
|
|
Post by alexfish on Jan 12, 2015 17:37:25 GMT 1
Hi All
hug_elm.bac lib :: Last in the daily scheme now at first post , includes final bug fixes + use Latest Bacon Beta 3.0.3
this will be replaced with a new scheme , Soon.
Also includes 3d Cube Demo.
BR Alex
|
|
|
Post by vovchik on Jan 12, 2015 18:14:22 GMT 1
Dear Alex, Great...and it works like a charm. Very nice work. Will now play.... With kind regards, vovchik
|
|
|
Post by alexfish on Jan 17, 2015 19:07:17 GMT 1
Hi Vovchik Found another anomaly in the Elementary docs , recommended method is show window last, here looking at what sent via PM , although main focus was on the widget side + access the evas canvas graphics so here if wanting to get further into the animators , they will not work as expected , even may fail to show the window all to to with get the canvas ID , if show window last then the low end libs does not recognize the canvas ID, but elm does anyway now one step further into this riddle of U'r slider Image Demo. got delayed on this one cos decided to try some bouncing balls , now the Enums for the effects work ,, now got bouncing and accelerating bits etc etc also got the GL canvas layer working , have to do this before a call to the window. all in can start the program like so, no need for a separate GL area , so from a beginners point of view , much the way Peter implements GL in hug , exception now been , GL canvas with widgets , + 3d drawing using maps and animators to take the strain. no need for beginner to access GL API , evas will do it , not top Notch gl , but unless U know the GL API (Syntax) Then Line, Rectangle , polygon , Textures as in images will give Beginners a start here the animators are the low level ecore_animator_** API . Looks like the soon is soon-later'ish BR Alex here setting up GL and get the correct Canvas ID. the Engine Option is now in the lib as "CANVAS GL" and not as posted INIT ecore_evas_init()
Engine("opengl_x11") my_engine$=EngineGet() PRINT " Engine Selected = " ,my_engine Let win = Window(win,"Test",600,400)
SHOW(win) canvas = CANVAS() : REM no need for size since the canvas is the eindow either x11 render or gl render.
|
|
|
Post by vovchik on Jan 17, 2015 19:30:54 GMT 1
Dear Alex, Take your time, since you are unearthing nice features. Textures in GL are great, so the graphics we will get will be impressive - and we can port some existing demos... With kind regards, vovchik
|
|
|
Post by alexfish on Jan 20, 2015 18:59:26 GMT 1
Hi Vochik
have been trying to to find a way around the gdk bits U mentioned, also re the stride
can see what U mean ,
upshot thing are different from earlier version , esp cairo verson rsvg version , old ways will not work.
did try the cairo surfaces that we did at experimental ,
the only one working is cairo_image_surface_create , the cairo_image_surface_create_for_data does not work.
thought that one would be the route into the gtk buffer , as experiment tried the
rsvg first , now here I be up a brick wall since the get dim of rsvg is returning 0,0 ?? so at present cannot render a direct rsvg to cairo
another problem , did try render with string data like we have done so many times. this doe not even load.
think there is a great deal to look at before can progress the subject in Elm terms , hence giving up on that for now
even more so since can not retrieve the necessary from rsvg , could be doing something wrong,
here looking at 'RsvgDimensionData dim' as in dim.width & dim.height, test both in line and frm file .. nothing!!!
did a temp have to allow more on the surface but all I get is a black Square.
at best squiggly lines . I am presuming that is what at best U got with gdk pixbuf
BR Alex
|
|
|
Post by vovchik on Jan 20, 2015 19:38:44 GMT 1
Dear Alex,
Too bad they changed so many things - and the cairo strings to path was useful. I got somewhere with the gtk_pixbuf - ei.e. something appearaed but not right - and will have a look at that again. It would be great to have the rsvg and pixbuf facilities available...or some kind of workaround.
With kind regards, vovchik
|
|
|
Post by alexfish on Jan 20, 2015 22:50:36 GMT 1
Hi Vovchik
think I must be nuts gave this a last shot and scored a hit , I put the data in manually.
this is hot off the press but it works.. needs more work. but at least got the image as pixels returning
will have to use the methods used at experimental ufo...
these are the compile flags for the ufo demo if can not find it let me know and will pm details Now if can get a char ** in , I think this could work. BR Alex
PRAGMA LDFLAGS `pkg-config --libs elementary cairo --libs --libs librsvg-2.0`
PRAGMA OPTIONS `pkg-config --cflags elementary cairo` PRAGMA OPTIONS `pkg-config --cflags elementary librsvg-2.0`
REM ----Render Rsvg-------------------------- PROTO rsvg_handle_render_cairo,RsvgHandle,cairo_image_surface_create_for_data ,rsvg_handle_get_dimensions PROTO rsvg_handle_new_from_file , rsvg_set_default_dpi
FUNCTION Render_RSVG() LOCAL *rsvg TYPE RsvgHandle LOCAL dim TYPE RsvgDimensionData LOCAL *pixels TYPE unsigned char LOCAL *surface2 TYPE cairo_surface_t LOCAL Width,Height,Stride TYPE double
REM width * sizeof(DATA32) LOCAL *cr TYPE cairo_t rsvg = rsvg_handle_new() svi = rsvg_handle_write(rsvg,"<svg width='300' height='100%' x='0' y='0'> <rect width='300' height='100' stroke='#FF7200' stroke-width='10' fill='none' /></svg>", 130, 0) REM svi = rsvg_handle_new_from_file("./button.svg",0) PRINT " Svi ",svi rsvg_handle_get_dimensions(rsvg, &dim) Width = dim.width; Height = dim.height; PRINT dim.width, " : " ,Height svi = rsvg_handle_close(rsvg, 0) mypix = rsvg_handle_get_pixbuf(rsvg)
surface2 = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, Width, Height) cr=cairo_create(surface2) rsvg_handle_render_cairo(rsvg, cr) cairo_surface_flush(surface2) pixels = cairo_image_surface_get_data(surface2) cairo_destroy(cr)
RETURN pixels END FUNCTION
Added the bit that makes it work is the height 100% , so now looking at the width , and char* the data to see if can get it to work
<svg width='300' height='100%' x='0' y='0'>
used that trick in the rad tool . now should be able to make a gtk text bufferif char* does not work.. do know gtk text buff works with rsvg ...
Updated , the 100% not so important but as far as the rectangle goes the the .width and .height from the rsvg data dim is IE
evas_object_image_size_set(img2, dim.width, dim.height) evas_object_image_data_set(img2, pixy) evas_object_resize(img2,dim.width,dim.height)
tested bacon STRING since char* did not work . now can use the below with the above rectangle size
DECLARE data TYPE STRING data ="<svg width='100' height='100' x='0' y='0'> <rect width='50' height='50' stroke='#FF7200' stroke-width='1' fill='#FF7200' opacity='0.5' /></svg>" svi = rsvg_handle_write(rsvg,data,LEN(data), 0) rsvg_handle_get_dimensions(rsvg, &dim) Width = dim.width; Height = dim.height;
To highlight again the setting of the image evas_object_image_size_set(img2, dim.width, dim.height)
|
|
|
Post by alexfish on Jan 21, 2015 12:40:50 GMT 1
Hi Vovchik
got the svg inline and file working on the evas canvas
here the demo "original ufo" can render Cairo + svg images inline + from file have not tested pixbuf :: see note at foot of code BR Alex
PRAGMA LDFLAGS `pkg-config --libs elementary cairo --libs --libs librsvg-2.0` PRAGMA OPTIONS `pkg-config --cflags elementary cairo` PRAGMA OPTIONS `pkg-config --cflags elementary librsvg-2.0` REM PRAGMA INCLUDE elementary-1/Elementary.h cairo/cairo.h librsvg/rsvg.h
'---cairo PROTO cairo_create PROTO cairo_rectangle PROTO cairo_set_source_rgb PROTO cairo_fill PROTO cairo_destroy PROTO cairo_surface_destroy PROTO cairo_scale PROTO cairo_image_surface_create_for_data PROTO cairo_surface_flush PROTO cairo_image_surface_create '---GUI PROTO Ecore_Evas , Evas_Object PROTO elm_policy_set PROTO elm_win_util_standard_add ALIAS WINDOW PROTO elm_win_autodel_set PROTO evas_object_resize PROTO evas_object_show PROTO elm_run PROTO elm_shutdown PROTO elm_init PROTO evas_object_rectangle_add, evas_object_color_set PROTO evas_object_move PROTO evas_object_evas_get PROTO ecore_evas_get PROTO evas_object_image_colorspace_set PROTO evas_object_image_size_set PROTO evas_object_image_data_set
'@ INIT elm_init(0,0)
'@ Declares DECLARE *img ,*img2 TYPE Evas_Object DECLARE *pixy TYPE unsigned char DECLARE *surface TYPE cairo_surface_t DECLARE canvas1 TYPE Evas* DECLARE *win TYPE Evas_Object DECLARE *bg TYPE Evas_Object DECLARE dim TYPE RsvgDimensionData REM ----Render Rsvg--------------------------
PROTO rsvg_handle_render_cairo,RsvgHandle,cairo_image_surface_create_for_data ,rsvg_handle_get_dimensions PROTO rsvg_handle_new_from_file , rsvg_set_default_dpi
FUNCTION INLINE_RSVG2UCHAR(STRING data)
LOCAL *rsvg TYPE RsvgHandle LOCAL *pixels TYPE unsigned char LOCAL *surface2 TYPE cairo_surface_t LOCAL *cr TYPE cairo_t rsvg = rsvg_handle_new() svi = rsvg_handle_write(rsvg,data,LEN(data), 0) rsvg_handle_get_dimensions(rsvg, &dim) svi = rsvg_handle_close(rsvg, 0) surface2 = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, dim.width, dim.height) cr=cairo_create(surface2) rsvg_handle_render_cairo(rsvg, cr) cairo_surface_flush(surface2) pixels = cairo_image_surface_get_data(surface2) cairo_destroy(cr) RETURN pixels END FUNCTION FUNCTION SVG_RSVG2UCHAR(STRING file)
LOCAL *rsvg TYPE RsvgHandle LOCAL *pixels TYPE unsigned char LOCAL *surface2 TYPE cairo_surface_t LOCAL *cr TYPE cairo_t rsvg = rsvg_handle_new_from_file(file,0) rsvg_handle_get_dimensions(rsvg, &dim) svi = rsvg_handle_close(rsvg, 0) surface2 = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, dim.width, dim.height) cr=cairo_create(surface2) rsvg_handle_render_cairo(rsvg, cr) cairo_surface_flush(surface2) pixels = cairo_image_surface_get_data(surface2) cairo_destroy(cr)
RETURN pixels END FUNCTION REM ----CAIRO UF0--------------------------
FUNCTION UFO(cairo_surface_t *cs) LOCAL *pixels TYPE unsigned char
color$="#FF00E2" DECLARE xs = 1 TYPE double DECLARE ys = 1 TYPE double DECLARE a = 700 TYPE double b = (double)a * a DECLARE c = 600 TYPE double DECLARE q,r,y TYPE double DECLARE i,m,n,p,x,st TYPE double ia = (double)1/a
LOCAL *cr TYPE cairo_t cr=cairo_create(cs)
'cairo_scale(cr,0.5,0.5) start=TIMER cairo_set_source_rgb(cr,1.0, 1.0,0.0) cairo_rectangle(cr, 0, 0,800, 800) cairo_fill(cr) cairo_scale(cr,0.5,0.5)
cairo_set_source_rgb(cr,DEC(MID$(color$, 2, 2)), DEC(MID$(color$, 4, 2)), DEC(MID$(color$, 6, 2)) )
FOR x = 0 TO a STEP 2 s = x * x p = SQR(b - s) st=6*ys FOR i = -p TO p STEP st r = SQR(s + i * i) /a q = (r -1.0) * SIN(24 * r) y = FLOOR(i/3 + q * c) IF i=-p THEN m=y n=y END IF IF y > m THEN m = y IF y < n THEN n = y IF m = y OR n = y THEN cairo_rectangle(cr, (double)-x+800, (double)y+700,2.0, 2.0) cairo_fill(cr) cairo_rectangle(cr, (double)x+800,(double)y+700,2.0, 2.0) cairo_fill(cr) END IF NEXT NEXT
cairo_surface_flush(cs) pixels = cairo_image_surface_get_data(cs) cairo_destroy(cr)
PRINT "Render Time ",TIMER-start , " mSec"
RETURN pixels
END FUNCTION
'@ END FUNCTIONS and SUBS
'--- test the GUI a simple window + find drawable + add rectangle HEIGHT=800 WIDTH = 800
elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED) win = WINDOW("bg-plain", "Bg Plain")
elm_win_autodel_set(win, EINA_TRUE) evas_object_resize(win, WIDTH, HEIGHT) evas_object_show(win)
'@ find drawable canvas1 = evas_object_evas_get(win)
' @ create cairo image similar to evas image @ CAIRO_FORMAT_ARGB32 surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, WIDTH, HEIGHT) ' @ create the ufo pixy = UFO(surface) ' @ create evas image to match cairo @ EVAS_COLORSPACE_ARGB8888 img = evas_object_image_filled_add(canvas1) evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888) evas_object_image_size_set(img, WIDTH, HEIGHT) evas_object_image_data_set(img, pixy) evas_object_resize(img, WIDTH, HEIGHT) evas_object_show(img) LOCAL data TYPE STRING data ="<svg width='100' height='100' x='0' y='0'><rect width='100' height='100' stroke='#FF7200' stroke-width='0' fill='#F3FF00' opacity='1.0' /> <rect width='50' height='50' stroke='#C200FF' stroke-width='1' fill='#C200FF' opacity='1.0' /></svg>" REM pixy = INLINE_RSVG2UCHAR(data) REM pixy = SVG_RSVG2UCHAR("./button.svg") img2 = evas_object_image_filled_add(canvas1) evas_object_image_colorspace_set(img2, EVAS_COLORSPACE_ARGB8888) evas_object_image_size_set(img2, dim.width, dim.height) evas_object_image_data_set(img2, pixy) evas_object_resize(img2, dim.width, dim.height) evas_object_move(img2,100,100) evas_object_show(img2) REM cairo_set_source_pixbuf elm_run() elm_shutdown() /*------------------------------------------------------------------------------- * can use pixbuff in this form to reneder to cairo gdk_cairo_set_source_pixbuf (cairo_t *cr, const GdkPixbuf *pixbuf, double pixbuf_x, double pixbuf_y); -----------------------------------------------------------------------------*/
' END ALL THAT
|
|
|
Post by vovchik on Jan 21, 2015 16:32:34 GMT 1
Dear Alex, Splendid work. I will look at it in detail tonight - because I have to finish up something urgent now - but I am impressed and happy. With kind regards, vovchik
|
|
|
Post by alexfish on Jan 29, 2017 13:56:43 GMT 1
Hi Vovchik
Dam .. got posted on wrong thread
|
|