Recent

Author Topic: Something like Cairo context  (Read 301 times)

Roland57

  • Jr. Member
  • **
  • Posts: 78
Something like Cairo context
« 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?

winni

  • Hero Member
  • *****
  • Posts: 1782
Re: Something like Cairo context
« Reply #1 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

Happy transformations!

Winni

Roland57

  • Jr. Member
  • **
  • Posts: 78
Re: Something like Cairo context
« Reply #2 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