Vision Posted September 24, 2019 Share Posted September 24, 2019 Hi I need to resize client side an image as function to another. I'm already able to move and get information as posizion and size but not able to resize clientside. example onclick: function click(sender, e, eOpts) { var xy=MainForm.UniImage1.getPosition(true); var x=xy[0]; var y=xy[1]; var w=MainForm.UniImage1.getWidth(); var h=MainForm.UniImage1.getHeight(); MainForm.UniImage2.setPosition(x+(w*417/768), y+(h*23/242)); MainForm.UniImage2.setSize(500,500); --> not work/ not able to find documentation } tnks all Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 24, 2019 Share Posted September 24, 2019 2 hours ago, cristian said: I need to resize client side an image as function to another. I'm already able to move and get information as posizion and size but not able to resize clientside. example onclick: Hi, Can you please explain in more detail by attaching a testcase? Quote Link to comment Share on other sites More sharing options...
Vision Posted September 24, 2019 Author Share Posted September 24, 2019 Hi I need to put procedure TMainForm.UniImage1Resize(Sender: TUniControl; OldWidth, OldHeight: Integer); begin UniImage2.Height := Trunc(UniImage1.Height * 146 / 242); UniImage2.Width := Trunc(UniImage1.Width * 146 / 768); end; into on click client side function click(sender, e, eOpts) { var xy=MainForm.UniImage1.getPosition(true); var x=xy[0]; var y=xy[1]; var w=MainForm.UniImage1.getWidth(); var h=MainForm.UniImage1.getHeight(); MainForm.UniImage2.setPosition(x+(w*417/768), y+(h*23/242)); } Tnks for help Please olso attach documentation eventiClient.7z Quote Link to comment Share on other sites More sharing options...
Vision Posted September 25, 2019 Author Share Posted September 25, 2019 15 hours ago, Sherzod said: Hi, Can you please explain in more detail by attaching a testcase? Hi example attached. I need to resize an image from UniButton2-->ClientEvents-->ExtEvents-->Ext.Button.Button-->click Tnks Quote Link to comment Share on other sites More sharing options...
Sherzod Posted September 25, 2019 Share Posted September 25, 2019 1 hour ago, cristian said: example attached. I will try to see... Quote Link to comment Share on other sites More sharing options...
Vision Posted September 25, 2019 Author Share Posted September 25, 2019 7 hours ago, Sherzod said: I will try to see... tnks man Quote Link to comment Share on other sites More sharing options...
Vision Posted October 1, 2019 Author Share Posted October 1, 2019 upd Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 1, 2019 Share Posted October 1, 2019 13 minutes ago, cristian said: upd Sorry for the late reply, may need to look for a different approach. It was also unclear why you are using "constants": MainForm.UniImage2.setPosition(x+(w*417/768), y+(h*23/242)); Quote Link to comment Share on other sites More sharing options...
Vision Posted October 1, 2019 Author Share Posted October 1, 2019 2 hours ago, Sherzod said: Sorry for the late reply, may need to look for a different approach. It was also unclear why you are using "constants": MainForm.UniImage2.setPosition(x+(w*417/768), y+(h*23/242)); The constant are used because this is a demo. Is only an offset. I did not understand your answer: I'm just asking for a way to resize an image client side. If is possible to move I suppose that is also possible to resize. I'm doing it wrong? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted October 1, 2019 Share Posted October 1, 2019 16 minutes ago, cristian said: I did not understand your answer: I'm just asking for a way to resize an image client side. If is possible to move I suppose that is also possible to resize. I'm doing it wrong? I'm sorry, I didn't understand your task too. 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.