jptec Posted December 21, 2016 Posted December 21, 2016 HI, I would like to change the panel background. I searched in general group that have below method function OnBeforerender(sender){sender.html='<img src="files/gradient.jpg" width="100%" height="100%"/>';} But in mobile panel, it does not have this. please advise also I need the canvas in mobile like the one desktop, any hints to do that? Joe
Sherzod Posted December 21, 2016 Posted December 21, 2016 Hi, I would like to change the panel background. I searched in general group that have below method function OnBeforerender(sender){sender.html='<img src="files/gradient.jpg" width="100%" height="100%"/>';} But in mobile panel, it does not have this. please advise For now you can try this, for example: procedure TMainmForm.UnimFormReady(Sender: TObject); begin with UnimPanel1 do begin JSInterface.JSCall('element.setStyle', ['background-image', 'url("files/gradient.jpg")']); JSInterface.JSCall('element.setStyle', ['background-size', '100% 100%']); end; end;
Sherzod Posted December 21, 2016 Posted December 21, 2016 also I need the canvas in mobile like the one desktop, any hints to do that? I hope that it will be added soon... Best regards.
jptec Posted December 22, 2016 Author Posted December 22, 2016 Hi, For now you can try this, for example: procedure TMainmForm.UnimFormReady(Sender: TObject); begin with UnimPanel1 do begin JSInterface.JSCall('element.setStyle', ['background-image', 'url("files/gradient.jpg")']); JSInterface.JSCall('element.setStyle', ['background-size', '100% 100%']); end; end; In my case , with reference above code but change as follow and tested as expected: uses uniGUIJSInterface; procedure TMainmForm.UnimFormReady(Sender: TObject); begin with (UnimPanel1 as IUniJSInterface) do begin JSCall('element.setStyle', ['background-image', 'url("files/gradient.jpg")']); JSCall('element.setStyle', ['background-size', '100% 100%']); end; end; Thanks for your help
jptec Posted December 22, 2016 Author Posted December 22, 2016 I hope that it will be added soon... Best regards. Hope can added soon as my upcomming project need it. Just wonder if the browser support html5 . It means desktop canvas also work in mobile? Like ipad safari or mobile chrome? Joe
Recommended Posts