diff --git a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets index 068cd118f5f39ae8e2687633df511b9efbed1737..94513f29d785dded7f47d729e6dfeb8d00b0d986 100644 --- a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets +++ b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets @@ -277,9 +277,18 @@ struct HomePage { height: this.imageHeight } this.showCanvas = true; + this.calcScale(); }); } + calcScale() { + let imageWidthScale = (this.screenWidth - CommonConstants.DOUBLE * CommonConstants.SCREEN_DISPLAY_MARGIN) / + this.imageOldSize.width; + let imageHeightScale = (this.screenHeight - CommonConstants.DOUBLE * CommonConstants.SCREEN_DISPLAY_MARGIN) / + this.imageOldSize.height; + this.imageScale = imageWidthScale > imageHeightScale ? imageHeightScale : imageWidthScale; + } + pixelInit() { this.showCanvas = false; getPixelMap(CommonConstants.RAW_FILE_NAME).then(pixelMap => {