Recent

Author Topic: Coordinate space transformations  (Read 6253 times)

tk

  • Sr. Member
  • ****
  • Posts: 368
Coordinate space transformations
« on: October 05, 2009, 12:42:33 am »
Hi,
in order to create the printing support (not just) for KGrid I would appreciate the SetWindowExtEx, SetViewPortExtEx and SetMapMode functions in Lazarus. Of course i can map manually but especially in controls with custom painting I'd like to use something "hidden" in the Canvas/device context. Are the transformations on the roadmap or even implementable for the other widget sets? Thanks

Paul Ishenin

  • Sr. Member
  • ****
  • Posts: 274
Re: Coordinate space transformations
« Reply #1 on: October 05, 2009, 03:27:56 am »
Some functions are available in LCLIntf unit. For example SetWindowOrgEx. You can try to implement missing in a similar way and to send us a patch.

tk

  • Sr. Member
  • ****
  • Posts: 368
Re: Coordinate space transformations
« Reply #2 on: October 05, 2009, 09:34:00 am »
OK. I'll give it a try because I really need them. At least for GTKx and QT where I can test it.

tk

  • Sr. Member
  • ****
  • Posts: 368
Re: Coordinate space transformations
« Reply #3 on: October 05, 2009, 12:50:30 pm »
I made a brief research about how this could be implemented under QT and GTKx. QT seems to be very easy by utilizing the QPainter_Scale function. But GTK does not natively support these transformations (Cairo does sth but would be too hard to implement). I'll have to make major modifications to the GTK interfaces by introducing eg. FScaleX and FScaleY fields (Double type) to TGTKDeviceContext and modify ALL painting methods. I can do this but the question is, will such huge change be accepted by the Lazarus development team and the community? I'm asking because of course I cannot test everything myself and thus cannot guarantee that the new feature will work for every possible case (but I think I can guarantee the default behavior remains unchanged if the three new functions will not be used).

 

TinyPortal © 2005-2018