Serg Posted June 20, 2019 Share Posted June 20, 2019 Во время работы программы меняю фон панели MainForm.UniPanel10.Background.URL:='111.jpg'; Но ничего не происходит Link to comment Share on other sites More sharing options...
Tokay Posted June 20, 2019 Share Posted June 20, 2019 странный какой-то url Link to comment Share on other sites More sharing options...
Serg Posted June 20, 2019 Author Share Posted June 20, 2019 из корня да я и другие пробовал. для UniImage работает Link to comment Share on other sites More sharing options...
Serg Posted June 20, 2019 Author Share Posted June 20, 2019 LoadFromFile не перегружает тоже Link to comment Share on other sites More sharing options...
Sherzod Posted June 20, 2019 Share Posted June 20, 2019 Здравствуйте. Пожалуйста, отправьте запрос в портал поддержки. Link to comment Share on other sites More sharing options...
Serg Posted June 20, 2019 Author Share Posted June 20, 2019 Спасибо! Link to comment Share on other sites More sharing options...
Sherzod Posted June 20, 2019 Share Posted June 20, 2019 1 hour ago, Serg said: Во время работы программы меняю фон панели Но ничего не происходит Как обходное решение, попробуйте этот код: with UniPanel1 do begin JSInterface.JSCall('setBodyStyle', ['background', 'url(files/tulips.jpg)']); if Background.Fit then JSInterface.JSCall('setBodyStyle', ['background-size', '100%']); end; Link to comment Share on other sites More sharing options...
Serg Posted June 21, 2019 Author Share Posted June 21, 2019 Добрый день! Большое спасибо!!! Link to comment Share on other sites More sharing options...
55143681 Posted January 10, 2020 Share Posted January 10, 2020 On 6/21/2019 at 2:18 AM, Sherzod said: Как обходное решение, попробуйте этот код: with UniPanel1 do begin JSInterface.JSCall('setBodyStyle', ['background', 'url(files/tulips.jpg)']); if Background.Fit then JSInterface.JSCall('setBodyStyle', ['background-size', '100%']); end; Does not work,sorry! How to do? Link to comment Share on other sites More sharing options...
Sherzod Posted January 10, 2020 Share Posted January 10, 2020 17 minutes ago, 55143681 said: Does not work,sorry! Can you make a simple testcase for check? Link to comment Share on other sites More sharing options...
55143681 Posted January 12, 2020 Share Posted January 12, 2020 On 1/10/2020 at 11:12 PM, Sherzod said: Can you make a simple testcase for check? Thank you,see the testPanelD.zip please, 10.3.3+1514,delphi and cuilder all work abnormal. testPanelD.zip Link to comment Share on other sites More sharing options...
Sherzod Posted January 12, 2020 Share Posted January 12, 2020 Ok, I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2020 Share Posted January 14, 2020 On 1/12/2020 at 5:03 AM, 55143681 said: see the testPanelD.zip please Hello, Firstly, in your test case, there are two folders named "files", image is located in the wrong folder. Secondly, the UniPanel.Background.Fit property is not set True, therefore, you will not see the image, since the size is not small (1920x1200) Also try this modified code: with UniPanel1 do begin JSInterface.JSCall('setBodyStyle', ['background-image', 'url(files/111.jpg)']); JSInterface.JSCall('setBodyStyle', ['background-repeat', 'no-repeat']); JSInterface.JSCall('setBodyStyle', ['background-position', 'center']); if Background.Fit then JSInterface.JSCall('setBodyStyle', ['background-size', '100%']); end; Link to comment Share on other sites More sharing options...
55143681 Posted January 17, 2020 Share Posted January 17, 2020 On 1/14/2020 at 6:48 PM, Sherzod said: Hello, Firstly, in your test case, there are two folders named "files", image is located in the wrong folder. Secondly, the UniPanel.Background.Fit property is not set True, therefore, you will not see the image, since the size is not small (1920x1200) Also try this modified code: with UniPanel1 do begin JSInterface.JSCall('setBodyStyle', ['background-image', 'url(files/111.jpg)']); JSInterface.JSCall('setBodyStyle', ['background-repeat', 'no-repeat']); JSInterface.JSCall('setBodyStyle', ['background-position', 'center']); if Background.Fit then JSInterface.JSCall('setBodyStyle', ['background-size', '100%']); end; Thanks a lot,Sherzod,works well for delphi, but I use unigui1514+cbuilder10.3.3, that doesn't work, Is there any wrong with my code? help me please,thanks. void __fastcall TUniFormStartBoard::UniBitBtn14Click(TObject *Sender) { UniPanelA->JSInterface->JSCall("setBodyStyle", "['background', 'url(files/111.jpg)']"); UniPanelA->JSInterface->JSCall("setBodyStyle","['background-repeat', 'no-repeat']"); UniPanelA->JSInterface->JSCall("setBodyStyle","['background-position', 'center']"); if(UniPanelA->Background->Fit) UniPanelA->JSInterface->JSCall("setBodyStyle","['background-size', '100%']"); } Link to comment Share on other sites More sharing options...
Sherzod Posted January 17, 2020 Share Posted January 17, 2020 1 hour ago, 55143681 said: Is there any wrong with my code? Is there an error in the browser console? Link to comment Share on other sites More sharing options...
55143681 Posted January 19, 2020 Share Posted January 19, 2020 On 1/17/2020 at 5:14 PM, Sherzod said: Is there an error in the browser console? There is nothing in console panel. Link to comment Share on other sites More sharing options...
55143681 Posted January 22, 2020 Share Posted January 22, 2020 On 1/19/2020 at 8:50 AM, 55143681 said: There is nothing in console panel. Dear Sherzod: can you try this under cbuilder for me? with delphi works well, but with cbuilder that does not work.See the code above. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now