Recent

Author Topic: Bitmap for Retina hi-res  (Read 4245 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2541
    • UVviewsoft
Bitmap for Retina hi-res
« on: December 26, 2016, 09:48:14 pm »
Hi

If I run my app on Mac, Retina, then copying TBitmap to panel (atsynedit is panel),
gives not ok result. Bitmap has usual dpi.
Panel canvas has retina dpi.
Bitmap paints not in hi res, not sharp.
TextOut on panel canvas==> text sharp
TextOut on bitmap + copy to panel canvas==> not sharp

What to do here? how to make bitmap "hi-res"? if I cannot paint on panel's canvas.

derek.john.evans

  • Guest
Re: Bitmap for Retina hi-res
« Reply #1 on: December 26, 2016, 09:52:03 pm »
Maybe post screenshots of the sharp/non sharp versions.

The only thing I can think of is a difference in TFont Quality.

http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/tfont.quality.html

AlexTP

  • Hero Member
  • *****
  • Posts: 2541
    • UVviewsoft
Re: Bitmap for Retina hi-res
« Reply #2 on: December 26, 2016, 10:29:24 pm »
You dont understand the Retina. retina video mode has same 1024x768(example)
but DPI is much bugger, 2x or 3x. App sees same screen size. It makes same font size. e.g. font size=12.
TextOut on Form makes hi-res font. sharp.
TextOut on bitmap ++ copy to form (GUI) makes low-res font.
« Last Edit: December 26, 2016, 10:31:02 pm by Alextp »

ps

  • Full Member
  • ***
  • Posts: 136
    • CSS
Re: Bitmap for Retina hi-res
« Reply #3 on: December 30, 2016, 08:34:08 am »
I have same problem :
http://forum.lazarus.freepascal.org/index.php/topic,33215.0.html

Painting on Form.Canvas with TBitmap is scaled (by DPI). Can't paint 1px to 1px :(
Small simple CSS/box model implementation: https://github.com/pst2d/csscontrols/tree/dev

circular

  • Hero Member
  • *****
  • Posts: 4391
    • Personal webpage
Re: Bitmap for Retina hi-res
« Reply #4 on: June 13, 2020, 05:24:45 pm »
You need to use a high resolution bitmap. To know the scaling factor use TControl.GetCanvasScaleFactor. Then do a stretch draw.
https://wiki.lazarus.freepascal.org/Cocoa_DPI
Conscience is the debugger of the mind

 

TinyPortal © 2005-2018