mMap | (Object) Object of the PmMap type that contains the following properties that specifies the transformation process:
x (mandatory) - X position of the left upper corner of the rectangle (in pixels)
y (mandatory) - Y position of the left upper corner of the rectangle (in pixels)
dx (mandatory) - Rectangle width (in pixels)
dy (mandatory) - Rectangle height (in pixels)
rotateAngle (optional) - Image rotation angle in degrees (rotation centre is in the middle of the defined rectangle). Examples:
0 (default) - no rotation
90 - rotate by angle 90°
45 - rotate by angle 45°
-45 = 270 - rotate by angle 270°
10.125 - rotate by angle 10.125° flip (optional) - Flip drawing.
0 (default) - no flip
1 - flip to vertical axis |
---|
var ctx = pEvent.GetCtx(0);
// ...
var mMap = Pm.CreatePmMap();
mMap.x = 10;
mMap.y = 10;
mMap.dx = 90;
mMap.dy = 90;
mMap.rotateAngle = 45;
mMap.flip = 1;
pEvent.CtxExt.prepareDrawRect(mMap);
// Detect new coordinates of the area dx and dy after transformation
var dx = mMap.drawDx;
var dy = mMap.drawDy;
// ...anything that will be drawn in the area 0 - dx and 0 - dy, will be shifted, flipped and rotated in the resulting drawing.