diff --git a/cameraApp/cameraApp/src/main/cpp/camera_ability_slice.cpp b/cameraApp/cameraApp/src/main/cpp/camera_ability_slice.cpp index 89d556fabb07907b02311f7590cdc6d8227f6570..22e3351ccf6a0c5f74cf8b20de1f7b990ec9b458 100755 --- a/cameraApp/cameraApp/src/main/cpp/camera_ability_slice.cpp +++ b/cameraApp/cameraApp/src/main/cpp/camera_ability_slice.cpp @@ -111,13 +111,22 @@ private: scaleWidth = static_cast(SCREEN_WIDTH) / imageWidth; if (imageHeight > SCREEN_HEIGHT) scaleHeight = static_cast(SCREEN_HEIGHT) / imageHeight; +#ifdef KEEP_PICTURE_RECT float scale = (scaleWidth < scaleHeight) ? scaleWidth : scaleHeight; transMap.Scale(Vector2(scale, scale), Vector2(0, 0)); +#else + transMap.Scale(Vector2(scaleWidth, scaleHeight), Vector2(0, 0)); +#endif backgroundView_->SetTransformMap(transMap); backgroundView_->SetTransformAlgorithm(TransformAlgorithm::NEAREST_NEIGHBOR); +#ifdef KEEP_PICTURE_RECT imageWidth = imageWidth * scale; imageHeight = imageHeight * scale; +#else + imageWidth = imageWidth * scaleWidth; + imageHeight = imageHeight * scaleHeight; +#endif } int16_t imagePosX = (SCREEN_WIDTH - imageWidth) / 2; /* 2 half */ int16_t imagePosY = (SCREEN_HEIGHT - imageHeight) / 2; /* 2 half */