使用滚动MFC C ++在PictureBox中绘制 [英] draw in picturebox with scroll mfc c++

查看:75
本文介绍了使用滚动MFC C ++在PictureBox中绘制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我想在Picture Box控件中绘制图片,我的目的是在图片框中添加滚动条,以便可以将其绘制的尺寸大于它的大小.我的意思是可以滚动来移动它的图片,
我尝试绘制的图片超出了图片框的大小,它进入了主框架面板,下面是我的代码.

Hi all,
I want to draw in Picture Box control my purpose is picture box have scroll bar that I can draw in it bigger than what It''s size I mean have scroll to move It''s picture,
I try to draw something more than picturebox''s size, It went to main frame panel my code is below.

void Cex133Dlg::OnBnClickedOk()
{
    CDC *myDC = GetDlgItem(IDC_DRAWBOX)->GetDC();	
    myDC->Rectangle(10, 10, 10, 20);
}




[已编辑]未选中会忽略文本中的HTML [/已编辑]




unchecked Ignore HTML in text[/Edited]

推荐答案

最好的方法是您应该使用CScrollview
对于图片查看器,我希望使用滚动视图而不是静态(图片框)控件.
即使跟随两个链接也可能对您有帮助.
如何将滚动条添加到图片框 [在一个静态页面上绘画+滚动它,如何? [通过滚动显示位图图像 [
Best way is you should use CScrollview
For a picture viewer I would prefer a scroll view instead of static (picture box) control.
even following two links may help you.
How to add scroll bar to picture box[^]

and

drawing on a cstatic + scrolling on it, How?[^]

Displaying Bitmap Images with Scrolling[^]

please try this links


这篇关于使用滚动MFC C ++在PictureBox中绘制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆