Friday 15 May 2015

delphi - FMX shape components does not correctly displayed on the Android platform -



delphi - FMX shape components does not correctly displayed on the Android platform -

as can see, shape components normal display on windows platform, smooth (including lines, corners , gradient effect).

but on android platform, unacceptable results: lines no longer smooth, corners cannot been closed, gradients become black.

how happen? , how prepare it?

here .fmx file content:

object form1: tform1 left = 0 top = 0 caption = 'form1' clientheight = 480 clientwidth = 640 formfactor.width = 320 formfactor.height = 480 formfactor.devices = [desktop] designermasterstyle = 0 object roundrect1: troundrect position.x = 40.000000000000000000 position.y = 16.000000000000000000 size.width = 153.000000000000000000 size.height = 65.000000000000000000 size.platformdefault = false stroke.color = clamediumslateblue stroke.thickness = 8.000000000000000000 end object pie1: tpie position.x = 32.000000000000000000 position.y = 96.000000000000000000 size.width = 153.000000000000000000 size.height = 129.000000000000000000 size.platformdefault = false stroke.color = clachocolate stroke.thickness = 8.000000000000000000 endangle = -90.000000000000000000 end object arc1: tarc position.x = 48.000000000000000000 position.y = 224.000000000000000000 size.width = 169.000000000000000000 size.height = 161.000000000000000000 size.platformdefault = false stroke.color = cladeeppink stroke.thickness = 10.000000000000000000 startangle = 30.000000000000000000 endangle = 180.000000000000000000 end object arc2: tarc position.x = 16.000000000000000000 position.y = 184.000000000000000000 size.width = 233.000000000000000000 size.height = 233.000000000000000000 size.platformdefault = false stroke.kind = gradient stroke.gradient.points = < item color = xff297e72 offset = 0.000000000000000000 end item color = xffa6f2bd offset = 1.000000000000000000 end> stroke.gradient.startposition.x = 0.500000000000000000 stroke.gradient.startposition.y = 1.000000000000000000 stroke.gradient.stopposition.x = 0.499999970197677600 stroke.gradient.stopposition.y = 0.000000000000000000 stroke.thickness = 20.000000000000000000 stroke.cap = round endangle = -90.000000000000000000 end end

i believe in docs says gradients on strokes (lines) not work on windows 2d rendering. wasn't able find says however. if want windows version utilize 3d can do:

initialization fmx.types.globalusegpucanvas := true;

you can turn on multisampling overriding rendering parameters. lastly can utilize native android component native drawing if need it.

android delphi graphics firemonkey

No comments:

Post a Comment