To make objects with aspect ratio of 1:1, move the mouse while holding down the Shift key when drawing / transforming. For rectangles / ellipses / rounded rectangles, set the AspectRatio property to False before using the mouse to draw the object.

For PasteImage objects, set the AspectRatio property to False when drawing and the SelectedObjectAspectRatio property when transforming. For Text and Stamp objects, set the WordWrap property to False when drawing and the SelectedObjectWordWrap property to False when transforming.

Example Code

Draws or transforms images, background fill texts, and stamps with squares, perfect circles, rounded squares, and an aspect ratio of 1: 1.

Drawing and transforming using the mouse

[When drawing / pasting]

Square / Round / Rounded Square

(1) Set the ImageKit1.Edit.EditKind property to Newtone.ImageKit.Win.KindOfEdit.Rectangle / Ellipse / RoundRectangle (* For ellipses and rectangles, the value of the AspectRatio property is irrelevant)
(2) Draw while holding down the Shift key

Square image》
(1) Set the ImageKit1.Edit.EditKind property to Newtone.ImageKit.Win.KindOfEdit.Image2) Set the ImageKit1.Edit.AspectRatio property to False
(3) Specify the pasting range while holding down the Shift key.
(4) Select and paste (4) Select and paste the image file in the dialog box

Text stamp with 1: 1 aspect ratio (background fill)
(1) Set the ImageKit1.Edit.EditKind property to Newtone.ImageKit.Win.KindOfEdit.Text / StampgeKit1.Edit.WordWrap property to False
(* Set the Newtone.ImageKit.Win.KindOfEdit.Fill property to True for background fill with text)
(3) Specify the drawing range while holding down the Shift key (* Press the Shift key before mouse down to specify the range.)
(4) Enter text and click outside the range to confirm

(* After specifying the drawing / pasting range, release the Shift key after mouse-up.)

[When transforming]

[When transforming]

Square / Round / Rounded Square
(1) Set the ImageKit1.Edit.AspectRatio property to Falsendependently, grab o(2) Select the drawn object independently, grab one of the blocks at the four corners, and hold down the Shift key while transforming.

Square image
(1) Select the pasted image object independently and set the ImageKit1.Edit.SelectedObjectAspectRatio property to False.hold down the Shift (2) Grab one of the four corner blocks and hold down the Shift key while transforming.

Text stamp with 1: 1 aspect ratio (background fill)
(1) Select the pasted text / stamp object independently and set the ImageKit1.Edit.SelectedObjectWordWrap property to False.Shift key while transforming.

(* This operation is possible even if it is not a square / circle / rounded square when drawing / pasting. Conversely, even if it is drawn / pasted as a square / circle / rounded square, press the Shift key when transforming. If you do not press it, the aspect ratio will not be 1: 1.
You can also change the behavior by pressing and releasing the Shift key even during mouse operation. )

(* After transforming, release the Shift key after mouse-up.)

When drawing and transforming with code

[Visual Basic.NET]

'When using Annotation function, the following property must be set to True.
ImageKit1.Edit.EditEnabled = True

[When drawing objects]
'Required only for PasteImage objects (for ellipses, rectangles and texts, the value of the AspectRatio property is irrelevant)
ImageKit1.Edit.AspectRatio = False
'Required only for text / stamps (for ellipses, rectangles and images, the value of the WordWrap property is irrelevant)
ImageKit1.Edit.WordWrap = False

'Set required properties such as color and line thickness
    ・
    ・
    ・
'Draw with the same value for the width and height of the argument Rectangle (example of drawing with height and width 100px at the position of x = 10, y = 50)
Dim drawRect As Rectangle = New Rectangle(10, 50, 100, 100)
Dim drawRectF As RectangleF = New RectangleF(10, 50, 100, 100) 'For Text/Stamp objects

'For squares / circles / rounded squares
ImageKit1.Edit.DrawRectangle/DrawEllipse/DrawRoundRectangle(drawRect)
'For PasteImage object
ImageKit1.Edit.PasteImage("imagefile.jpg", drawRect)
'For Text / Stamp objects
ImageKit1.Edit.DrawText(drawRectF)

[At the time of tranformation]
'Select the object to be transformed (assuming the target object number is 3)
ImageKit1.Edit.SelectObject(3)

'For rectangles / ellipses / rounded rectangles, the value of the AspectRatio property is irrelevant when transforming with code.
'The following settings are required for PasteImage objects
ImageKit1.Edit.SelectObjectAspectRatio = False
'The following settings are required only for Text / Stamp objects
ImageKit1.Edit.SelectObjectWordWrap = False

'Set the configuration coordinates after the size change (height / width 200px at the position of x = 10, y = 50)
Dim newPoints As Point() = {New Point(10, 50), New Point(210, 250)}
ImageKit1.Edit.SelectedObjectDrawPoints = newPoints

[Visual C#.NET]

//When using Annotation function, the following property must be set to True.
ImageKit1.Edit.EditEnabled = true;

[When drawing objects]
//Required only for PasteImage objects (for ellipses, rectangles and texts, the value of the AspectRatio property is irrelevant)
ImageKit1.Edit.AspectRatio = false;
//Required only for text / stamps (for ellipses, rectangles and images, the value of the WordWrap property is irrelevant)
ImageKit1.Edit.WordWrap = False

//Set required properties such as color and line thickness
    ・
    ・
    ・
//Draw with the same value for the width and height of the argument Rectangle (example of drawing with height and width 100px at the position of x = 10, y = 50)
Rectangle drawRect = new Rectangle(10, 50, 100, 100);
RectangleF drawRectF = new RectangleF(10F, 50F, 100F, 100F); //For text/stamp objects

//For squares / circles / rounded squares
ImageKit1.Edit.SelectObjectDrawPoints/DrawEllipse/DrawRoundRectangle(drawRect);
//For PasteImage objects
ImageKit1.Edit.PasteImage("imagefile.jpg", drawRect);
'For text / stamp objects
RectangleF drawRectF = new RectangleF(10F, 50F, 100F, 100F); //Draw at height and width 100px at x = 10, y = 50
ImageKit1.Edit.DrawText(drawRectF)

[At time of transformation]
//Select the object to be transformed (assuming the target object number is 3)
ImageKit1.Edit.SelectObject(3);

//For rectangles / ellipses / rounded rectangles, the value of the AspectRatio property is irrelevant when transforming with code.
//The following settings are required only for PasteImage objects
ImageKit1.Edit.SelectObjectAspectRatio = false;
//The following settings are required only for Text / Stamp objects
ImageKit1.Edit.SelectObjectWordWrap = false;

//Set the configuration coordinates after size change (height and width 200px at the position of x = 10, y = 50)
Point[] newPoints = {new Point(10, 50), new Point(210, 250)};
ImageKit1.Edit.SelectedObjectDrawPoints = newPoints;

Relevant Properties

ImageKit.Edit.AspectRatio
ImageKit.Edit.WordWrap
ImageKit.Edit.SelectedObjectAspectRatio
ImageKit.Edit.SelectedObjectWordWrap
ImageKit.Edit.SelectedObjectDrawPoints

Relevant Methods

ImageKit.Edit.DrawRectangle
ImageKit.Edit.DrawEllipse
ImageKit.Edit.DrawRoundRectangle
ImageKit.Edit.DrawText
ImageKit.Edit.PasteImage
ImageKit.Edit.SelectObject

The ImageKit WPF is created by Newtone Corporation