Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firemonkey drawing on bitmap without interpolation

I am using the canvas draw functions drawrect and filltext to draw onto a Tbitmap but I don't want the results antialiased. Anyone know how to do that ?

Working with OSX and Delphi XE3 (but have XE4 and XE5 if needed)

like image 505
David Peters Avatar asked Mar 23 '26 15:03

David Peters


1 Answers

Is the problem:

  1. the bitmap you create seems to have anti-aliasing present in the data?
  2. or have you got a good bitmap and want to disable anti-aliasing in the viewer/display?

If it is the former, have you checked that the anti-aliasing is actually present in the bitmap, and not introduced by your viewer?

In the past I've found it useful to draw a black-on-white test pattern, and display the image at 1:1 scale. Irfanview is a nice tool for viewing at 'true' scale. Then use a loupe/peak/lens to get a close-up of the actual pixels.

Black-on-white test patterns are particularly good since you should be able to see (hopefully) that the R,G and B sub-pixels are all equally illuminated when there is no anti-aliassing present. If you draw a black-on white pattern and you get solitary bright sub-pixels then you've definitely got anti-aliassing (or some other form of corruption!).

My experience has been that image viewers often do interpolation for you, and it can be tricky to see what is going on unless you look at the actual bitmap data or have a close-up look at the unscaled image...

like image 114
GnomeDePlume Avatar answered Mar 25 '26 12:03

GnomeDePlume



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!