Serg Posted June 20, 2019 Posted June 20, 2019 Во время работы программы меняю фон панели MainForm.UniPanel10.Background.URL:='111.jpg'; Но ничего не происходит Quote
Serg Posted June 20, 2019 Author Posted June 20, 2019 из корня да я и другие пробовал. для UniImage работает Quote
Sherzod Posted June 20, 2019 Posted June 20, 2019 Здравствуйте. Пожалуйста, отправьте запрос в портал поддержки. Quote
Sherzod Posted June 20, 2019 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; Quote
55143681 Posted January 10, 2020 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? Quote
Sherzod Posted January 10, 2020 Posted January 10, 2020 17 minutes ago, 55143681 said: Does not work,sorry! Can you make a simple testcase for check? Quote
55143681 Posted January 12, 2020 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 Quote
Sherzod Posted January 14, 2020 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; Quote
55143681 Posted January 17, 2020 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%']"); } Quote
Sherzod Posted January 17, 2020 Posted January 17, 2020 1 hour ago, 55143681 said: Is there any wrong with my code? Is there an error in the browser console? Quote
55143681 Posted January 19, 2020 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. Quote
55143681 Posted January 22, 2020 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. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.