How to programmatically lock the ratio of scaling and sizing of an image imported on curve using C#

Hi iam Yogesh Sharma and i am a  C# developer and  not  very familiar with coreldraw(when using with c#)

My problem is that i am programmatically importing image on a curve using the following C# code.

d.ActiveLayer.Import(imgpath);// image path is path of the cdr file

                                            var v = d.ActiveShape;

                                            v.SizeHeight = 20.00;

                                            v.SizeWidth = 15.00;

                                            v.AddToPowerClip(s);

Now when i run this code the image gets placed into the curve bit it gets streched  vertically means the face of  a student(that comes from imagepath) get streched  vertically..When i do this Madnually with scaling and sizing ratio locked it gets properly inserted in curve...Please Help Me. If AnyBody  Can or suggest some other solution.. Its very urgent Please...Any Help will be appreciated..

Parents
No Data
Reply
  • Hi.

    Use v.SetSize w, h

    parameter are optional but you must put at least one or the other.

    IE:

    v.SetSize w

    or

    v.SetSize , h

     

    You might want to learn VBA, at least a little. It's easier to code and debug, then translate your VBA code to C#

    ~John

     

Children