How to draw "curved" lines?


Daniel

The problem is simple, as the title says.

Tizen's documentation is really unreliable on this topic (among others).

For example, as they describe here :

Draw SVG paths. You can use the api in efl_gfx_utils.h to construct the path

...

efl_gfx_path_append_circle(&path_cmd, &points);

efl_gfx_utils.hIs it in the Tizen5.5 SDK.

They also removed the following features: evas_vg_shape_append_move_to, evas_vg_shape_append_line_to.

So the question remains, how can I draw a curve to preferrably ?Evas_Object

Suya

In 6.0 you can use these APIs. How about developing in 6.0?

Another suggested method is to use Cairo. See here for more details. https://docs.tizen.org/application/native/guides/graphics/cairo/

I tested the following code in 5.5. and I checked that code works.

int w = 360, h = 360;
Evas_Object *img = evas_object_image_filled_add(evas_object_evas_get(ad->win));
elm_win_resize_object_add(ad->win, img);
evas_object_image_content_hint_set(img, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
evas_object_image_size_set(img, w, h);
evas_object_image_colorspace_set(img, EVAS_COLORSPACE_ARGB8888);
evas_object_image_alpha_set(img, 0);
evas_object_show(img);

cairo_surface_t *cairo_surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, w, h);
cairo_t *cairo = cairo_create(cairo_surface);
/* Cairo drawing */
cairo_set_source_rgba(cairo, 1.0, 0.0, 0.0, 1.0);
cairo_arc(cairo, 30, 150, 100 * sqrt(2), -0.25 * M_PI, 0.25 * M_PI);
cairo_close_path(cairo);
cairo_stroke(cairo);
cairo_surface_flush(cairo_surface);
unsigned char *imageData = cairo_image_surface_get_data(cairo_surface);
if(imageData){
    evas_object_image_data_set(img, imageData);
    evas_object_image_data_update_add(img, 0, 0, w, h);
}

enter image description here

Hope this way helps you.

Related


How to draw "curved" lines?

Daniel The problem is simple, as the title says. Tizen's documentation is really unreliable on this topic (among others). For example, as they describe here : Draw SVG paths. You can use the api in efl_gfx_utils.h to construct the path ... efl_gfx_path_append_

How to draw curved and straight lines in one image?

stack I'm trying to draw a rectangle that is basically a circle, with a square on one end. Kind of like a battery. I have some limitations, basically this can only be done with a single paint object and should be able to support strokes. Here is my code so far

How to draw curved and straight lines in one image?

stack I'm trying to draw a rectangle that is basically a circle, with a square on one end. Kind of like a battery. I have some limitations, basically this can only be done with a single paint object and should be able to support strokes. Here is my code so far

How to draw curved shadows?

Ilutov like this: I know this doesn't work NSShadow, drawRect:plugging it in does the trick. David Rönnqvist You can use Core Animations layers and shadowPathproperties to do this and many other types of shadows . The shadow you describe can be generated by an

How to draw a line with curved ends

Sheikh How can I draw the horizontal line shown in the image above (curved upwards from the left end) in the XML file through the selector? Below is my selector file code. thanks <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.andro

How to draw curved SVG paths

Raphael How would I (if possible) draw a black border only along the inside of this svg. I've tried strokes and adding the stroke width, but this wraps the whole svg. Is there a way to stop the stroke at a specific point? div{ width: 300px; margin: 0 auto;

How to draw curved SVG paths

Raphael How would I (if possible) draw a black border only along the inside of this svg. I've tried strokes and adding the stroke width, but this wraps the whole svg. Is there a way to stop the stroke at a specific point? div{ width: 300px; margin: 0 auto;

How to draw a line with curved ends

Sheikh How can I draw the horizontal line shown in the image above (curved upwards from the left end) in the XML file through the selector? Below is my selector file code. thanks <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.andro

How to draw curved arrows with CreateJS?

graphics problem The JavaScript code for drawing the curved arrow is already in this fiddle : http://jsfiddle.net/SguzM/ I want to do the same thing using CreateJS library. The fiddle code above is as follows: var can = document.getElementById('canvas1'); var

How to draw curved arrows with CreateJS?

graphics problem The JavaScript code for drawing the curved arrow is already in this fiddle : http://jsfiddle.net/SguzM/ I want to do the same thing using CreateJS library. The code from the fiddle above is as follows: var can = document.getElementById('canvas

How to draw a line with curved ends

Sheikh How can I draw the horizontal line shown in the image above (curved upwards from the left end) in the XML file through the selector? Below is my selector file code. thanks <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.andro

How to draw curved SVG paths

Raphael How would I (if possible) draw a black border only along the inside of this svg. I've tried strokes and adding the stroke width, but this wraps the whole svg. Is there a way to stop the stroke at a specific point? div{ width: 300px; margin: 0 auto;

How to draw a line with curved ends

Sheikh How can I draw the horizontal line shown in the image above (curved upwards from the left end) in the XML file through the selector? Below is my selector file code. thanks <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.andro

How to draw curved arrows with CreateJS?

graphics problem The JavaScript code for drawing the curved arrow is already in this fiddle : http://jsfiddle.net/SguzM/ I want to do the same thing using CreateJS library. The code from the fiddle above is as follows: var can = document.getElementById('canvas

How to draw curved SVG with single path?

Weber What I want is in the image below - I have 3 relative questions about this 1. We can use single path. Paint the entire canvas ? 2. If we can only use multiple paths to draw the whole, will it be convenient to animate them? 3. In both cases, who can kindl

How to draw curved text using MFC functions?

user How to draw curved text using MFC functions? I want to achieve something like this below. The DrawText() function only draws text on straight lines, I don't know how to draw curved text at a specific angle. please help me. thanks. Derry Wu - MSFT You can

ThreeJS how to draw shapes with curved edges

geoffs3310 I'm trying to make a shape using threeJS consisting of straight and curved edges. Currently I have the following: I want the two top corners to be joined by a semicircle so it ends up being a square with a semicircle cut out from the top like so: wh

How to draw arcs with curved edges in iOS?

Ballas In one of my applications I am trying to draw gradient arcs with rounded corners. As shown below. This is what I have done so far with the following code. -(void)startArc { UIBezierPath *roundedArc = [self arcWithRoundedCornerAt:centerPoint startAn

How to draw curved SVG with single path?

Weber What I want is in the image below - I have 3 relative questions about this 1. We can use single path. Paint the entire canvas ? 2. If we can only use multiple paths to draw the whole, will it be convenient to animate them? 3. In both cases, who can kindl

How to draw curved SVG with single path?

Weber What I want is in the image below - I have 3 relative questions about this 1. We can use single path. Paint the entire canvas ? 2. If we can only use multiple paths to draw the whole, will it be convenient to animate them? 3. In both cases, who can kindl

How to draw curved arrows in canvas android

Zheng Xian I have this code that draws the arrow tail between 2 points, but how should I draw the curve for the arrow tail? canvas.drawLine(pt1[X], pt1[Y], pt2[X], pt2[Y], paint);//draw line I want something like this where the arrows are dynamic Ted Hope Dep

How to draw curved text using MFC functions?

user How to draw curved text using MFC functions? I want to achieve something like this below. The DrawText() function only draws text on straight lines, I don't know how to draw curved text at a specific angle. please help me. thanks. Derry Wu - MSFT You can

How to draw curved text using MFC functions?

user How to draw curved text using MFC functions? I want to achieve something like this below. The DrawText() function only draws text on straight lines, I don't know how to draw curved text at a specific angle. Please help me. thanks. Derry Wu - MSFT You can

How to draw arcs with curved edges in iOS?

Ballas In one of my applications I am trying to draw gradient arcs with rounded corners. As shown below. This is what I have done so far with the following code. -(void)startArc { UIBezierPath *roundedArc = [self arcWithRoundedCornerAt:centerPoint startAn

How to draw curved SVG with single path?

Weber What I want is in the image below - I have 3 relative questions about this 1. We can use single path. Paint the entire canvas ? 2. If we can only use multiple paths to draw the whole, will it be convenient to animate them? 3. In both cases, who can kindl

How to draw curved SVG with single path?

Weber What I want is in the image below - I have 3 relative questions about this 1. We can use single path. Paint the entire canvas ? 2. If we can only use multiple paths to draw the whole, will it be convenient to animate them? 3. In both cases, who can kindl

How to draw curved text using MFC functions?

user How to draw curved text using MFC functions? I want to achieve something like this below. The DrawText() function only draws text on straight lines, I don't know how to draw curved text at a specific angle. Please help me. thanks. Derry Wu - MSFT You can

How to draw a rectangle with one side curved in html

Langjak Is it possible to draw a rectangle and bend the top in html? The shape should appear at the bottom of the html page, which is required for the footer. Maroon Crossing Try this: this should only show the first step :-) .wrapper { width: 500px; heigh

How to draw lines in Java

Karoline Brynildsen: I was wondering if there is a function in Java to draw a line from coordinates (x1,x2) to (y1,y2)? What I want to do is something like this: drawLine(x1, x2, x3, x4); And I'd like to be able to do this at any point in the code so that mul