[Gambas-user] Coordinate system in Gambas Graphics

Benoit Minisini gambas at ...1...
Fri Dec 5 15:38:14 CET 2008


On mercredi 3 décembre 2008, Charles Capaday wrote:
> I'm interested in developing a graph object in Gambas to plot points,
> curves etc. Are there language statements for coordinate transformations
> such as to make, for example, the pixel locations of a rectangle into
> x,y coordinate values?
>
>
> Cheers,
>
>
> Dr. Charles Capaday
> Professor & Director
> Brain and Movement Lab.
> Dept. of Anatomy & Physiology
> Faculty of Medicine, Laval University
> http://www.brainandmovementlab.org/
>
> Mailing address:
> CRULRG F-6500
> Hopital Robert-Giffard
> 2601 de la Canardiere, Beauport, QC
> G1J 2G3 Canada
>
> Tel: +418-663-5747 (Sec.)
>        +418-663-5000 ext. 6736 (Off.)
>        +418-663-5000 ext. 6877 (Lab.)
> Fax: +418-663-8756
>

No, because it is not very complex to do. Moreover, you have to use different 
algorithms according to what you are drawing.

If you want to draw a curve, a simple matrix multiplication and a translation 
applied to point coordinates are enough.

But if you want to implement a print preview (fox example), you will have to 
map positions and dimensions differently, to minimize drawing errors.

Regards,

-- 
Benoit Minisini




More information about the User mailing list