Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-12

Stretching Antialiasing in win32

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Felipe Monteiro de Carvalho

Hello,

When I execute the StretchBlt windows API in the magnifier I get different results in Delphi and in Lazarus:

  Windows.StretchBlt(DestCanvas.Handle, drawGlassRect.Left, drawGlassRect.Top,
   drawGlassWidth, drawGlassHeight,
   bmpDisplay.Canvas.Handle, viewRect.Left, viewRect.Top,
   viewRectWidth, viewRectHeight, dwROP);

In Lazarus there is notice some anti-aliasing. When magnifying the same synedit text in delphi and lazarus, after 14x or so I start to see grey dots near the text and in Delphi I don't. Actually the grey dots are also square, so they actually look like as if they were part of the text, but they cannot be, because I saw the same text with delphi.

Setting the canvas Antialiasingmode property has no effect.

Any ideas why this happens? It's not necessarely bad, but I would like to control this via the antialiasing property.

Felipe Monteiro de Carvalho

Reply by email

Martin Friebe
to Felipe Monteiro de Carvalho
Felipe Monteiro de Carvalho wrote 22 lines
Hello, When I execute the StretchBlt windows API in the magnifier I get different results in Delphi and in Lazarus: Windows.StretchBlt(DestCanvas.Handle, drawGlassRect.Left, drawGlassRect.Top, drawGlassWidth, drawGlassHeight, bmpDisplay.Canvas.Handle, viewRect.Left, viewRect.Top, viewRectWidth, viewRectHeight, dwROP); In Lazarus there is notice some anti-aliasing. When magnifying the same synedit text in delphi and lazarus, after 14x or so I start to see grey dots near the text and in Delphi I don't. Actually the grey dots are also square, so they actually look like as if they were part of the text, but they cannot be, because I saw the same text with delphi. Setting the canvas Antialiasingmode property has no effect. Any ideas why this happens? It's not necessarely bad, but I would like to control this via the antialiasing property.

Your font may be drawn using anti-aliasing before you magnify/stretch the bitmap, so you would see the grey areas caused by the anti aliasing.

If it is synedit, check either the font antialiasing/quality property in object inspector (if you use synedit as component). Or Environment=>options=>Editor=>Display there is a checkbox "Disable anti aliasing"

Best regards
Martin

Reply by email

Felipe Monteiro de Carvalho
to Martin Friebe
Martin Friebe wrote
If it is synedit, check either the font antialiasing/quality property in object inspector (if you use synedit as component). Or Environment=>options=>Editor=>Display there is a checkbox "Disable anti aliasing"

Anti aliasing is disabled.

And also, this wouldn't explain the difference to delphi

Felipe Monteiro de Carvalho

Reply by email

Marc Weustink
to Felipe Monteiro de Carvalho: When I execute the StretchBlt windows API in the magnifier I get different results in…
Felipe Monteiro de Carvalho wrote 21 lines
Hello, When I execute the StretchBlt windows API in the magnifier I get different results in Delphi and in Lazarus: Windows.StretchBlt(DestCanvas.Handle, drawGlassRect.Left, drawGlassRect.Top, drawGlassWidth, drawGlassHeight, bmpDisplay.Canvas.Handle, viewRect.Left, viewRect.Top, viewRectWidth, viewRectHeight, dwROP); In Lazarus there is notice some anti-aliasing. When magnifying the same synedit text in delphi and lazarus, after 14x or so I start to see grey dots near the text and in Delphi I don't. Actually the grey dots are also square, so they actually look like as if they were part of the text, but they cannot be, because I saw the same text with delphi. Setting the canvas Antialiasingmode property has no effect. Any ideas why this happens? It's not necessarely bad, but I would like to control this via the antialiasing property.

Delphi uses StretchBlt, but I'm not sure (and I'm to lazy too look in the source) if laz does too in all cases. For the ease of it might be that I use AlphaBlend.

Marc

Reply by email