1.打开同类型的位图,文件按顺序排列时可顺序打开下一张图像;
2.用鼠标滚轮完成图像的放大及缩小,且以鼠标所指的像素点为固定像素点;
3.显示图像的绝对像素坐标和相对像素坐标,并且显示图像的放大比例。
1.在放大的时候,会遇到图像上、下、左、右侧超出显示控件的情况,因此在放大的时候,需要判断图像边界位置。
2.在放大及缩小的时候要保证图像长宽同比变换,即保证图像不失真。
3.在找出图像绝对像素坐标和相对像素坐标时,要注意比例转换。
4.开始楼主敲得代码,在缩放图像时,总是出现闪屏的现象,后来才发现原因,不能直接在控件里放置图像,需要在缓存一 次,就解决闪屏现象。
void CImageViewDlg::OnSize(UINT nType, int cx, int cy)
{
if (m_listRect.GetCount() > 0)
{
CRect dlgNow;
GetWindowRect(&dlgNow);
POSITION pos = m_listRect.GetHeadPosition();//第一个保存的是对话框的Rect
CRect dlgSaved;
dlgSaved = m_listRect.GetNext(pos);
ScreenToClient(dlgNow);
float x = dlgNow.Width() * 1.0 / dlgSaved.Width();//根据当前和之前保存的对话框的宽高求比例
float y = dlgNow.Height() *1.0 / dlgSaved.Height();
ClientToScreen(dlgNow);
CRect childSaved;
CWnd* pWnd = GetWindow(GW_CHILD);
while (pWnd)
{
childSaved = m_listRect.GetNext(pos);//依次获取子窗体的Rect
childSaved.left = dlgNow.left + (childSaved.left - dlgSaved.left)*x;//根据比例调整控件上下左右距离对话框的距离
childSaved.right = dlgNow.right + (childSaved.right - dlgSaved.right)*x;
childSaved.top = dlgNow.top + (childSaved.top - dlgSaved.top)*y;
childSaved.bottom = dlgNow.bottom + (childSaved.bottom - dlgSaved.bottom)*y;
ScreenToClient(childSaved);
pWnd->MoveWindow(childSaved);
pWnd = pWnd->GetNextWindow();
}
CWnd *pwnd = GetDlgItem(IDC_Picture);
pwnd->GetClientRect(&picRect);
CDC *pDC = pwnd->GetDC();
pDC->SetStretchBltMode(COLORONCOLOR);
Image.Destroy();
File_Open = Image.Load(FilePath);
if (File_Open != 0)
{
File_Open = 2;
return;
}
RectSize(Image, picRect, curRect, Image_scale);
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
}
}
void CImageViewDlg::OnBnClickedOpenFile()
{
CString filter = L"所有文件(*.bmp,*.jpg,*.tiff)|*.bmp;*.jpg;*.gif;*.tiff| BMP(*.bmp)|*.bmp|JPG(*.jpg)|*.jpg|GIF(*.gif)|TIFF(*.tiff)|*.tiff";
CFileDialog Ofile(TRUE, NULL, NULL, OFN_HIDEREADONLY, filter, NULL);
g_iZoom = 1;
g_iRadio = 0.5;
if (IDOK == Ofile.DoModal())
{
FilePath = Ofile.GetPathName();
CString fEnt = Ofile.GetFileExt();
End_name = fEnt.MakeLower();
File_Folder = FilePath.Left(FilePath.GetLength() - End_name.GetLength() - 2);
CString tmp_count = FilePath.Left(FilePath.GetLength() - End_name.GetLength() - 1);
tmp_count = tmp_count.Right(1);
count = _ttoi(tmp_count);
CWnd* pWnd = GetDlgItem(IDC_Picture);
CDC* pDC = pWnd->GetDC();
HDC hDC = pDC->m_hDC;
pWnd->GetClientRect(&picRect);
Image.Destroy();
Image.Load(FilePath);
Image_Rat = (float)Image.GetWidth() / (float)Image.GetHeight();
RectSize(Image, picRect, curRect, Image_scale);
::SetStretchBltMode(hDC, HALFTONE);
::SetBrushOrgEx(hDC, 0, 0, NULL);
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
SetDlgItemText(IDC_Text1, FilePath);
ReleaseDC(pDC);
}
// TODO: 在此添加控件通知处理程序代码
}
void CImageViewDlg::OnBnClickedNextFile()
{
CString filter = L"所有文件(*.bmp,*.jpg,*.tiff)|*.bmp;*.jpg;*.gif;*.tiff| BMP(*.bmp)|*.bmp|JPG(*.jpg)|*.jpg|GIF(*.gif)|TIFF(*.tiff)|*.tiff";
CFileDialog Ofile(TRUE, NULL, NULL, OFN_HIDEREADONLY, filter, NULL);
CString tmp_Path, tmp_count;
g_iZoom = 1;
g_iRadio = 0.5;
count++;
tmp_count.Format(_T("%01d."), count);
FilePath = File_Folder + tmp_count + End_name;
CWnd* pWnd;
pWnd = GetDlgItem(IDC_Picture);
CDC* pDC = pWnd->GetDC();
HDC hDC = pDC->m_hDC;
pWnd->GetClientRect(&picRect);
Image.Destroy();
File_Open = Image.Load(FilePath);
if (File_Open != 0)
{
count--;
tmp_count.Format(_T("%01d."), count);
FilePath = File_Folder + tmp_count + End_name;
File_Open = Image.Load(FilePath);
File_Open = 2;
return;
}
Image_Rat = (float)Image.GetWidth() / (float)Image.GetHeight();
RectSize(Image, picRect, curRect, Image_scale);
::SetStretchBltMode(hDC, HALFTONE);
::SetBrushOrgEx(hDC, 0, 0, NULL);
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
SetDlgItemText(IDC_Text1, FilePath);
ReleaseDC(pDC);
// TODO: 在此添加控件通知处理程序代码
}
void CImageViewDlg::RectSize(CImage &inputImage, CRect &inputRect, CRect &outputRect, float &imput_scale)
{
float in_x, in_y;
in_x = inputRect.Width();
in_y = inputRect.Height();
float rows, cols;
rows = inputImage.GetHeight();
cols = inputImage.GetWidth();
float rat = cols / rows;
if (rows > in_y && cols < in_x)
{
imput_scale = rows / in_y;
outputRect.left = (in_x - (in_y * rat)) / 2;
outputRect.right = outputRect.left + (in_y * rat);
outputRect.top = 0;
outputRect.bottom = in_y;
}
else if (rows in_x)
{
imput_scale = cols / in_x;
outputRect.left = 0;
outputRect.right = in_x;
outputRect.top = (in_y - (in_x / rat)) / 2;
outputRect.bottom = outputRect.top + (in_x / rat);
}
else if (rows > in_y && cols > in_x)
{
if ((rows / in_y) >= (cols / in_x))
{
imput_scale = rows / in_y;
outputRect.left = (in_x - (in_y * rat)) / 2;
outputRect.right = outputRect.left + (in_y * rat);
outputRect.top = 0;
outputRect.bottom = in_y;
}
else if ((rows / in_y) < (cols / in_x))
{
imput_scale = cols / in_x;
outputRect.left = 0;
outputRect.right = in_x;
outputRect.top = (in_y - (in_x / rat)) / 2;
outputRect.bottom = outputRect.top + (in_x / rat);
}
}
else if (rows < in_y && cols = (in_x / cols))
{
imput_scale = cols / in_x;
outputRect.left = 0;
outputRect.right = in_x;
outputRect.top = (in_y - (in_x / rat)) / 2;
outputRect.bottom = outputRect.top + (in_x / rat);
}
else if ((in_y / rows) < (in_x / cols))
{
imput_scale = rows / in_y;
outputRect.left = (in_x - (in_y * rat)) / 2;
outputRect.right = outputRect.left + (in_y * rat);
outputRect.top = 0;
outputRect.bottom = in_y;
}
}
}
BOOL CImageViewDlg::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt)
{
GetDlgItem(IDC_Picture)->GetWindowRect(&picRect);
CWnd *pwnd = GetDlgItem(IDC_Picture);
CDC *pDC = pwnd->GetDC();
pDC->SetStretchBltMode(COLORONCOLOR);
if (picRect.PtInRect(Win_Point))
{
int w = Image.GetWidth(), h = Image.GetHeight();
if (zDelta > 0)
{
if (g_iZoom >= 30)
{
CString tmp_rat = _T("图像最大百分比");
SetDlgItemText(IDC_Text3, tmp_rat);
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
return CDialogEx::OnMouseWheel(nFlags, zDelta, pt);
}
double zoom = g_iZoom + g_iRadio;
g_iZoom = zoom;
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
}
else if (zDelta < 0)
{
double zoom = g_iZoom - g_iRadio;
g_iZoom = zoom;
if (g_iZoom <= 1)
{
g_iZoom = 1;
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
CString tmp_rat = _T("图像最小百分比");
SetDlgItemText(IDC_Text3, tmp_rat);
g_iZoom = 1;
return CDialogEx::OnMouseWheel(nFlags, zDelta, pt);
}
ZoomImage(Image, picRect, curRect, g_iZoom, Image_scale);
}
}
return CDialogEx::OnMouseWheel(nFlags, zDelta, pt);
}
void CImageViewDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
if (curRect.Width()*(g_iZoom) = picRect.Width())
{
tmp_curRect = picRect;
if (tmp_curRect.PtInRect(Win_Point))
{
LButtonDown = true;
Down_Point = curPoint;
}
}
return CDialogEx::OnLButtonDown(nFlags, point);
}
void CImageViewDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
if (curRect.Width()*(g_iZoom) = picRect.Width())
{
tmp_curRect = picRect;
if (tmp_curRect.PtInRect(Win_Point))
{
LButtonDown = false;
}
}
LButtonDown = false;
return CDialogEx::OnLButtonUp(nFlags, point);
}
void CImageViewDlg::ZoomImage(CImage &input_Image, CRect &client_Rect, CRect &show_Rect, double &Zoom, float &input_scale)
{
m_isMove = false;
GetDlgItem(IDC_Picture)->GetWindowRect(&picRect);
CWnd *pwnd = GetDlgItem(IDC_Picture);
CDC *pDC = pwnd->GetDC();
HDC hDC = pDC->m_hDC;
pDC->SetStretchBltMode(COLORONCOLOR);
pwnd->GetClientRect(&picRect);
float Rows = input_Image.GetHeight();
float Cols = input_Image.GetWidth();
CString tmp_rat;
CDC MemDC;
CBitmap MemBitmap;
MemDC.CreateCompatibleDC(NULL);
MemBitmap.CreateCompatibleBitmap(pDC, picRect.Width(), picRect.Height());
MemDC.SelectObject(&MemBitmap);
MemDC.FillSolidRect(0, 0, picRect.Width(), picRect.Height(), RGB(240, 240, 240));//填充初始颜色
MemDC.SetStretchBltMode(HALFTONE); ///HALFTONE
if (curRect.Width() * Zoom < picRect.Width())
{
show_Point.x = 0;
show_Point.y = m_imagePoint.y - (((Cols / (((float)curRect.Width()*Zoom) / (float)picRect.Height())) * curPoint.y)/picRect.Height());
if (show_Point.yBitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / Zoom) / ((curRect.Width() * Zoom) / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
tmp_Zoom = Zoom;
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.y + (Cols / (((float)curRect.Width()*Zoom) / (float)picRect.Height()))) > Rows)
{
show_Point.y = Rows - (Cols / (((float)curRect.Width()*Zoom) / (float)picRect.Height()));
input_Image.Draw(MemDC.GetSafeHdc(), ((picRect.Width() - curRect.Width() * Zoom) / 2), picRect.top, (curRect.Width() * Zoom), picRect.Height(),
show_Point.x, show_Point.y, Cols, (Cols / (((float)curRect.Width()*Zoom) / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / Zoom) / ((curRect.Width() * Zoom) / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
tmp_Zoom = Zoom;
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), ((picRect.Width() - curRect.Width() * Zoom) / 2), picRect.top, (curRect.Width() * Zoom), picRect.Height(),
show_Point.x, show_Point.y, Cols, (Cols / (((float)curRect.Width()*Zoom) / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY); ////SRCCOPY
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / Zoom) / ((curRect.Width() * Zoom) / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
tmp_Zoom = Zoom;
}
else if (curRect.Width() * Zoom >= picRect.Width())
{
show_Point.x = m_imagePoint.x - (int) ((float)(Cols * curPoint.x) / ((float)picRect.Width() *(Zoom - tmp_Zoom + 1)));
show_Point.y = m_imagePoint.y - (int) ((float)(Cols * curPoint.y) / ((float)picRect.Width() *(Zoom - tmp_Zoom + 1)));
if (show_Point.x <0)
{
show_Point.x = 0;
if (show_Point.y BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY); ////SRCCOPY
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.y + ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()))) > Rows) /////左下角一次判断
{
show_Point.y = Rows - ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()));
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY); ////SRCCOPY
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY); ////SRCCOPY
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if (show_Point.y < 0)
{
show_Point.y = 0;
if (show_Point.x BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.x + (Cols / (Zoom - tmp_Zoom + 1))) > Cols) ///右上角一次判断
{
show_Point.x = Cols - (Cols / (Zoom - tmp_Zoom + 1));
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.x + (Cols / (Zoom - tmp_Zoom + 1))) > Cols)
{
show_Point.x = Cols - (Cols / (Zoom - tmp_Zoom + 1));
if (show_Point.y BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if((show_Point.y + ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()))) > Rows) ////右下角一次判断
{
show_Point.y = Rows - ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()));
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.y + ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()))) > Rows)
{
show_Point.y = Rows - ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height()));
if (show_Point.x BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
if ((show_Point.x + (Cols / (Zoom - tmp_Zoom + 1))) > Cols)
{
show_Point.x = Cols - (Cols / (Zoom - tmp_Zoom + 1));
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY);
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
return;
}
input_Image.Draw(MemDC.GetSafeHdc(), picRect.left, picRect.top, picRect.Width(), picRect.Height(),
show_Point.x, show_Point.y, (Cols / (Zoom - tmp_Zoom + 1)), ((Cols / (Zoom - tmp_Zoom + 1)) / ((float)picRect.Width() / (float)picRect.Height())));
pDC->BitBlt(picRect.left, picRect.top, picRect.Width(), picRect.Height(), &MemDC, 0, 0, SRCCOPY); ////SRCCOPY
tmp_rat.Format(_T("图像百分比: %d "), (int)(100 * picRect.Height() / ((Cols / (Zoom)) / ((float)picRect.Width() / (float)picRect.Height()))));
SetDlgItemText(IDC_Text3, tmp_rat);
}
move_Point = show_Point;
m_realPoint = show_Point;
m_movePoint = show_Point;
}