rdelphi Posted April 29, 2018 Posted April 29, 2018 Is there a possibility to rotate (180,90,270 Degree) the UniImage? Quote
Sherzod Posted April 29, 2018 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
mhmda Posted April 29, 2018 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
rdelphi Posted April 30, 2018 Author 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
rdelphi Posted April 30, 2018 Author Posted April 30, 2018 THANKS :D mohammad , Delphi Developer Quote
rdelphi Posted May 1, 2018 Author 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
mhmda Posted May 1, 2018 Posted May 1, 2018 It will rotate only 'UniImage1' or what you want. 1 Quote
JohanC Posted September 19, 2018 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
Sherzod Posted September 19, 2018 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
JohanC Posted September 19, 2018 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
GerhardV Posted September 20, 2018 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
JohanC Posted September 20, 2018 Posted September 20, 2018 Hi Gerhard, Thanks, it works ! Johan (South Africa) 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.