ImgUpdate Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:15

Description

Updates all selected pictures on the current page, comparing the size of the picture to be updated with the size of the bounding box on the page.

Syntax

Page.ImgUpdate (int1, bln2, boolEx)

int1        

percentage limit

If the new image is within this tolerance, resize the image.

If greater than, crop the image;

if new image is smaller than current, place the smaller image on the page.

if the value is negative the picture is never cropped, i.e. if it is not within the absolute value of the tolerance it is left in the 'to update' status

The percentage parameters works as follows: Fred computes the percentage variation of picture width and height, using the formulas:

<width percentage variation> = (<New width>-<old width>)*100/<old width>

<height percentage variation> = (<New height>-<old height>)*100/<old height>

if both are less or equal to the percentage parameter the picture is resized, either anisotropically or isotropically depending on the value of the second parameter. if at least one of the percentages is greater than the percentage parameter the picture is cropped, keeping the center if it is bigger than the element, decreasing the size of the element if it is smaller.

Setting the percentage parameters to 0 the updated pictures are always cropped.

bln2

if true the resizing will be isotropic, i.e. without changes in the picture aspect ratio, but possibly with changes in the size of the element in page. if false the resize will be anisotropic, i.e. the picture aspect ratio may be changed but the element in page will keep exactly the same size.

boolEx

if true, prevents losing the scaling and crop position when updating an existing picture that has been reprocessed by OPI and which width and height differ slightly from the existing one.

Remarks

Returns an error code.

Context

Page designer

All image related commands

AddImageEx, ArticleNewPicture, ImgInsert, ImgInsertId, ImgInsertType, ImgNewDummyEx

ImgCrop, ImgSetCrop, GetImgCropHeight, GetImgCropLeft, GetImgCropTop, GetImgCropWidth, GetImgHeight, GetImgWidth

ImgZoom, ImgZoomPct, ViewZoomImage, GetImgZoomPctX, GetImgZoomPctY

GetSelectedImgId, GetSelectedImgDummy,

ImgGetColor, ImgSetColor, ImgGetFlag, ImgSetFlag, ImgImportPath Method

ImgTrace, ImgTraceDlg, ImgTraceEx

ImgUpdate, TxtSelectReference, ViewShowImg