/*
//切图区域
s_Image_Info &stDispImgInfo = spImgInfo->m_stDispInfo;
s_Image_Info stCutImgInfo;
CRect rtImgRegion = theDataService.GetModelAnalyzer()->GetCurtImgRegion(m_iWorkStationNo);
nWidth = rtImgRegion.Width();
nHeight = rtImgRegion.Height();
auto f1 = [&rtImgRegion,&stCutImgInfo,&stDispImgInfo]() {
CRect rtCutMy;
rtCutMy.left = min(rtImgRegion.left, rtImgRegion.right);
rtCutMy.right = max(rtImgRegion.left, rtImgRegion.right);
rtCutMy.top = stDispImgInfo.nImageHeight - 1 - max(rtImgRegion.top, rtImgRegion.bottom);
rtCutMy.bottom = stDispImgInfo.nImageHeight - 1 - min(rtImgRegion.top, rtImgRegion.bottom);
s_Image_Info temp;
temp.nImageWidth = rtCutMy.right - rtCutMy.left + 1;
temp.nImageHeight = rtCutMy.bottom - rtCutMy.top + 1;
temp.nImageBits = stDispImgInfo.nImageBits;
//temp.pImageBuf = new BYTE[getImageBufferSize(temp.nImageWidth, temp.nImageHeight, temp.nImageBits)];
int size = temp.nImageWidth * temp.nImageHeight * temp.nImageBits / 8;
temp.pImageBuf = new BYTE[size];
//int nLineWidthSrc = (stDispImgInfo.nImageWidth * (stDispImgInfo.nImageBits / 8) + 3) / 4 * 4;
//int nLineWidthDst = (temp.nImageWidth * (temp.nImageBits / 8) + 3) / 4 * 4;
int nLineWidthSrc = stDispImgInfo.nImageWidth * (stDispImgInfo.nImageBits / 8);
int nLineWidthDst = temp.nImageWidth * (temp.nImageBits / 8);
const BYTE* const sImageInfoSrcBuffer = stDispImgInfo.pImageBuf;
BYTE* const sImageInfoDstBuffer = temp.pImageBuf;
for (int i = rtCutMy.top; i <= rtCutMy.bottom; i++) {
const auto pSrc = sImageInfoSrcBuffer + i * nLineWidthSrc + rtCutMy.left * (stDispImgInfo.nImageBits / 8);
const auto pDst = sImageInfoDstBuffer + (i - rtCutMy.top) * nLineWidthDst;
memcpy(pDst, pSrc, nLineWidthDst);
}
//stCutImgInfo = std::move(temp);
stCutImgInfo = temp;
};
f1();
*/
s_Image_Info_Re dstImage;
s_Image_Info &srcImage = spImgInfo->m_stDispInfo;
CRect rect = theDataService.GetModelAnalyzer()->GetCurtImgRegion(m_iWorkStationNo);
theDataService.GetModelAnalyzer()->GetCutImage(dstImage, srcImage, rect);
nWidth = dstImage.width;
nHeight = dstImage.height;
PBYTE pImageBuf = &dstImage.data[0];
m_wndImageShow.DisplayImage(pImageBuf, nWidth, nHeight, (srcImage.nImageBits + 7) / 8, false);