rdelphi Posted April 29, 2018 Share Posted April 29, 2018 Is there a possibility to rotate (180,90,270 Degree) the UniImage? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 29, 2018 Share Posted April 29, 2018 Hi, Is there a possibility to rotate (180,90,270 Degree) the UniImage? Which edition and build are you using? Quote Link to comment Share on other sites More sharing options...
mhmda Posted April 29, 2018 Share Posted April 29, 2018 This may help you: $(MainForm.UniImage1.el.dom).css({ "-webkit-transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "transform": "rotate(90deg)" }); Quote Link to comment Share on other sites More sharing options...
rdelphi Posted April 30, 2018 Author Share Posted April 30, 2018 Hi, Which edition and build are you using? uniGUI Complete Trial Edition 1.0.2 Build 1450 This may help you: $(MainForm.UniImage1.el.dom).css({ "-webkit-transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "transform": "rotate(90deg)" }); Where do I use this code? I want to click on the button to rotate the UniImage Please see this code : https://gist.github.com/seungjin/131025 Is it possible to use? How to use? Quote Link to comment Share on other sites More sharing options...
mhmda Posted April 30, 2018 Share Posted April 30, 2018 Button->Ext events->Click. It's js code. Quote Link to comment Share on other sites More sharing options...
rdelphi Posted April 30, 2018 Author Share Posted April 30, 2018 THANKS :D mohammad , Delphi Developer Quote Link to comment Share on other sites More sharing options...
rdelphi Posted May 1, 2018 Author Share Posted May 1, 2018 This may help you: $(MainForm.UniImage1.el.dom).css({ "-webkit-transform": "rotate(90deg)", "-moz-transform": "rotate(90deg)", "transform": "rotate(90deg)" }); Your code will rotate all images While I want the user to rotate the images What are you suggesting for this? Quote Link to comment Share on other sites More sharing options...
mhmda Posted May 1, 2018 Share Posted May 1, 2018 It will rotate only 'UniImage1' or what you want. 1 Quote Link to comment Share on other sites More sharing options...
JohanC Posted September 19, 2018 Share Posted September 19, 2018 I would like to rotate the image 180 degrees when I click the Button the second time. And 270 degrees when I click it the third time And undo the rotation with the fourth click Can you please help? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 19, 2018 Share Posted September 19, 2018 Well, you might think about logic, let's say store the value through a variable and use the above solution or this: Quote Link to comment Share on other sites More sharing options...
JohanC Posted September 19, 2018 Share Posted September 19, 2018 Hi Sherzod, Yes I agree, the logic I can figure out I do not know where to insert the variable in the JS code. It works if I use 4 Buttons, but that is rather ugly Quote Link to comment Share on other sites More sharing options...
GerhardV Posted September 20, 2018 Share Posted September 20, 2018 Just save it on the Form and with every click you update it from 90 to 180 and so on..then update the JS code above to reflect the value. protected vDegrees: integer; On the button click: vDegrees := vDegrees + 90; -- you have to add some logic when it gets to 360 UniImage1.JSInterface.JSCode(#1'.el.query("img")[0].style.transform="rotate('+ vDegrees +'deg)";'); 1 Quote Link to comment Share on other sites More sharing options...
JohanC Posted September 20, 2018 Share Posted September 20, 2018 Hi Gerhard, Thanks, it works ! Johan (South Africa) Quote Link to comment Share on other sites More sharing options...
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.