Jump to content

resize image client side


Vision

Recommended Posts

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 
 

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...