Ecere SDK/eC Forums
http://ecere.org/community/
Print view

Drawing
http://ecere.org/community/viewtopic.php?f=5&t=371
Page 1 of 1
Author:  samsam598 [ Tue Aug 27, 2013 8:44 am ]
Post subject:  Drawing

Greetings!

I recalled I've asked whether there is a 2D Drawing class to let me draw some 2D stuffs,like pie,ellipse ,rounded rectangle,brushes,regions etc,something MS called device context or GDI+ drawing.Possibly I describled my question in a wrong way.

What I acually want to do is just with whatever utils/class/tools in ecere,I can do this.That will be great.

You may refer to the attached pictures for your easy refernce.

Could you please figure me out where should I start?Appreciated.

Regards,
Sam
Author:  jerome [ Tue Aug 27, 2013 10:28 am ]
Post subject:  Re: Drawing

Hi Sam, we were planning to add all these shapes at some point, except for the spline curve you have in there. (We probably should add it as well).

As for the regions, I'm not sure what that is, that looks like some special raster operations (COPY / AND / OR / XOR / NOT) for the fills with special colors for results? I'm not sure what kind of API would allow you to do this easily.

As for your plots screenshots, I believe you can do all this easily with the current API. You can use Area() to render the filled regions, Rectangle() for borders, DrawLine() for rendering the lines/curves and PutPixel() if you need finer control, like perhaps for this 2D Histogram graphics.

One thing you may have trouble doing though is vertical text, I don't think we have support in for that yet, but we'll put it on our list of things to add!

To clarify, our 2D class at the moment drawing is the Surface object, so everything we currently support is within Surface, and that is likely where new functionality will be added.
At the moment it's mostly geared towards drawing simple GUI controls, bitmaps and text, so it is somewhat limited. It is also possible (but inconvenient) to use the low level 3D drawing primitives from the Display class in OpenGL or Direct3D mode to render these shapes, but would require a lot of code (We hope to make this more accessible in a 2D drawing mode).

Regards,

Jerome
All times are UTC-05:00 Page 1 of 1