Recent

Author Topic: Timage & AntialiasingMode  (Read 5594 times)

airpas

  • Full Member
  • ***
  • Posts: 179
Timage & AntialiasingMode
« on: April 28, 2014, 04:15:44 pm »
hi
does the (AntialiasingMode) property works in Timage ?
i set it to amOn but nothing changed ! . iam drawing on timage using ( timage.canvas.Line , Polygon .... )

lazarus 1.1 / fpc 2.7.1 / win7

Blaazen

  • Hero Member
  • *****
  • Posts: 2919
  • POKE 54296,15
    • Eye-Candy Controls
Re: Timage & AntialiasingMode
« Reply #1 on: April 28, 2014, 04:27:30 pm »
Don't know about Windows7 (I have only wine). It works in Qt but not in GTK2. So it seems that this feature is platform-dependent. Definitely, Canvas.Line(); is perfectly antialiased in Qt4 when I use mode amOn.
Lazarus 2.1.0 r63881 FPC 3.3.1 r40507 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

circular

  • Hero Member
  • *****
  • Posts: 3446
    • Personal webpage
Re: Timage & AntialiasingMode
« Reply #2 on: April 28, 2014, 04:57:18 pm »
Antialiasing mode does not work on Windows.
Conscience is the debugger of the mind

taazz

  • Hero Member
  • *****
  • Posts: 5365
Re: Timage & AntialiasingMode
« Reply #3 on: April 29, 2014, 02:02:59 am »
The reason is that the Tcanvas is using GDI under the hood to draw and GDI does not support anti-aliased mode for graphics. you need to use a different engine eg GDI+ or use the aggpas library that comes with lazarus for painting on a buffer and copy that buffer to the image afterwards, although I think that there is a rasterizer for tbimaps included with aggpas.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

circular

  • Hero Member
  • *****
  • Posts: 3446
    • Personal webpage
Re: Timage & AntialiasingMode
« Reply #4 on: April 29, 2014, 11:53:58 pm »
Or use my library BGRABitmap. An TBGRABitmap object has a property CanvasBGRA, that provides the same function as TCanvas, except that antialiasing always works.
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018