在CImageArea类中调用CGIFJPGDlg类的DrawSelectedImage函数:
1. 在CImageArea类的.cpp文件中include CGIFJPGDlg类的头文件
#include "GIFJPGDlg.h"
2. 在要调用的函数中使用下面的语句:
void CImageArea::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
// Do not call CStatic::OnPaint() for painting messages
CGIFJPGDlg* pWnd = static_cast<CGIFJPGDlg*>(GetParent()); // 这句 code 的方法有时运行会出现 excepection thrown,可以用下面蓝字的 code 试试
pWnd->DrawSelectedImage();
}
CGIFJPGDlg* pWnd = (CGIFJPGDlg*)(GetParent()) -> GetParent();

本文介绍如何在CImageArea类中通过调用CGIFJPGDlg类的DrawSelectedImage函数实现图像绘制。首先需要在CImageArea的.cpp文件中包含CGIFJPGDlg的头文件,然后在OnPaint函数中通过类型转换获取父窗口指针并调用绘图函数。
2337

被折叠的 条评论
为什么被折叠?



