Lazarus

Programming => Graphics => Graphics and Multimedia => BGRABitmap and LazPaint => Topic started by: Roland57 on April 21, 2020, 08:25:28 pm

Title: Something like Cairo context
Post by: Roland57 on April 21, 2020, 08:25:28 pm
Hello!

I am thinking of doing for BGRABitmap something like Cairo context. But before I go, I would to be sure that it doesn't already exists.

Cairo context is like global variables, including not only simple things like current color or current pen width, but also a coordinate system, that you can change (translate, scale, rotate), save and restore. I hope that what I say is understandable.

I attach some examples that show the principle.

Is there something like that in BGRABitmap?
Title: Re: Something like Cairo context
Post by: winni on April 21, 2020, 08:46:33 pm
Hi!

You are on the right road:

BGRAbitmap defines a 2D-Canvas, with which you can scale or rotate your graphic objects.

It is decribed in Chapter 14 in the tutorial:

https://wiki.freepascal.org/BGRABitmap_tutorial_14/de (https://wiki.freepascal.org/BGRABitmap_tutorial_14/de)

Happy transformations!

Winni
Title: Re: Something like Cairo context
Post by: Roland57 on April 21, 2020, 09:12:49 pm
@winni

Thank you for your suggestion and for the link. Indeed, I never used Canvas2D. I will try.

Regards.

Roland
TinyPortal © 2005-2018