When using the mouse to select an area on the image, this property sets the ratio of the height to the width in that selected area

[C++Builder]   imagekitcontrolname->RectDrawRatio[= double ]
[Delphi]   imagekitcontrolname.RectDrawRatio[= Double ]

Property Value

The ratio of the height to the width in the selected area (default value is 0 meaning ratio is not set)

Explanation

When using the mouse to select an area on the image, RectDrawRatio property sets the ratio of the height to the width in that selected area. For this property to be enabled, the RectDraw property must be True. When the RectDrawRatio property is 0 (default value) there is no set ratio between the height and width of the selected area. Since the ratio is defined as heigth/width, values of more than 1 mean that the height of the selected area will be greater than the width. Likewise values less than 1 mean the width will be greater than the length.


Below is a code snippet that illustrates how to set the ratio of the height and width in the selected area to be the same as in the currently displayed image.

In C++Builder:

  bool Ret;

  VImageKit1->LayerNo = -1;

  Ret = VImageKit1->GetImageType();

  if (Ret == false) return;

  VImageKit1->RectDrawRatio = VImageKit1->ImageHeight / VImageKit1->ImageWidth;

  VImageKit1->RectDraw = true;

 

In Delphi:

  Ret: Boolean;

  VImageKit1.LayerNo := -1;

  Ret := VImageKit1.GetImageType;

  if Ret = False then Exit;

  VImageKit1.RectDrawRatio := VImageKit1.ImageHeight / VImageKit1.ImageWidth;

  VImageKit1.RectDraw := True;

Setting this value

This value can be set at design-time and run-time.

Retrieving this value

This value can be retrieved at run-time.

 

The ImageKit10 VCL is a product created by Newtone Corporation