提交 6181c06b 编写于 作者: U unknown 提交者: starfish

fixed 5abaa594 from https://gitee.com/starfish002/applications_sample_camera/pulls/82

fix captured picture viewed on cameara app issue
Signed-off-by: Nunknown <shaoyuan.zhang@huawei.com>
上级 14641222
......@@ -111,13 +111,22 @@ private:
scaleWidth = static_cast<float>(SCREEN_WIDTH) / imageWidth;
if (imageHeight > SCREEN_HEIGHT)
scaleHeight = static_cast<float>(SCREEN_HEIGHT) / imageHeight;
#ifdef KEEP_PICTURE_RECT
float scale = (scaleWidth < scaleHeight) ? scaleWidth : scaleHeight;
transMap.Scale(Vector2<float>(scale, scale), Vector2<float>(0, 0));
#else
transMap.Scale(Vector2<float>(scaleWidth, scaleHeight), Vector2<float>(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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册