I'am building a Firmonkey mobile application.
I have a phone (Galaxy S3). the absolute resolution of this device is 1280 x 720. When I ask for canvas.width i get 640x360. I know that Scale, is the connection between absolute resolute, and what canvas size is.
My problem.
When I draw a line on the canvas, with thickness := 1
, then i want the line to be as thin as possible.
If I do this:
if Self.Canvas.BeginScene then
try
Self.Canvas.Stroke.Thickness := 1;
Self.Canvas.Stroke.Kind := TBrushKind.Solid;
Self.Canvas.Fill.Color := TAlphaColorRec.Black;
Self.Canvas.Fill.Kind := TBrushKind.Solid;
for I := 1 to 20 do
Self.Canvas.DrawLine(PointF((I * 30), 0), PointF((I * 20), ClientHeight), 1);
finally
Self.Canvas.Canvas.EndScene;
end;
These lines will not be equaly "thin" on my display. If compiled to windows, it works as it should.
Further more: If i want to display a picture that has dimensions which exactly matches my device absolute resolution (1280x780), then this picture is not showed perfect, but resized to some lower resolution (equal to the canvas)...
So how on earth can I make my canvas to access EVERY pixels on my device, so I can control every pixels myself???
I've been to the page: http://www.fmxexpress.com/perfect-line-thickness-using-tcanvas-drawline-with-delphi-xe5-firemonkey-on-android-and-ios/ But this is a wok around (that does not work). I does not help getting/using the absolute resolution.