Jump to content

panel background and canvas


jptec

Recommended Posts

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

Link to comment
Share on other sites

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;
Link to comment
Share on other sites

 

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

Link to comment
Share on other sites

 

 
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

Link to comment
Share on other sites

×
×
  • Create New...