Drawline fails after apply own style

  

By user3732574 Hi thank you in anticipation of your help.

The following code works on Delphi Pro XE 6 : FMX HD – compile for Win 64 / Mac Os

Rectangle1.Canvas.BeginScene ;
Rectangle1.Canvas.Stroke.Kind := TBrushKind.bkSolid;
Rectangle1.Canvas.Stroke.Color := clared;
Rectangle1.Canvas.Stroke.Thickness :=3;
Rectangle1.canvas.drawline(pointf((RoundLogicPointsToMatchPixel(900)),120),
pointf((RoundLogicPointsToMatchPixel(980)),120),1);
Rectangle1.Canvas.EndScene;

BUT when i load and apply my own style it no longer works i.e. No line is drawn.
The rest of my program works fine, showing the correct style.

procedure TStartFrm.FormCreate(Sender: TObject);
var
Style: TFMXObject;
begin

{$IFDEF MSWINDOWS}
Style := TStyleManager.LoadFromResource(HInstance, ‘winmystyle’, RT_RCDATA);
{$ENDIF}
{$IFDEF MACOS}
Style := TStyleManager.LoadFromResource(HInstance, ‘macmystyle’, RT_RCDATA);
{$ENDIF}
if Style nil then
TStyleManager.SetStyle(Style);

end;
…read more

Via: StackOverflow

Comments are closed.