滚动重绘帮助 [英] Help with scrolling repaint

查看:100
本文介绍了滚动重绘帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要一种重画方案,使cah可以处理由文本和图形混合而成的显示.

如果显示的内容是文本或图形,我可以在滚动后处理重绘,但是一旦将两者混合使用,对我来说就是一个挑战.

我通过将窗口擦拭干净,浏览容纳文本的缓冲区并考虑滚动位置来显示适合当前页面的文本来处理文本显示.

我通过将所有输出直接放到内存dc中,然后使用BitBlt从内存DC复制到窗口DC中来处理图形的显示.

我的应用程序使用用户无法编辑的预定格式处理各种显示类型.文本具有不同的大小和样式.

看到Internet Explorer,我只是在徘徊它如何无缝处理文本和位图的误操作.

我曾经开发过用于处理此显示的公式编制器,但是它会在向上滚动时产生某种形式的显示.

使用内存直流将是一个完美的解决方案,除了以下事实:窗口不允许选择的位图大小超出某个限制.

请,我需要一个滚动后重涂方案,该方案可以无缝处理文本和图形的混合.

通过图形,我表示JPEGS和.bmp位图.

我使用本机编程,而不使用MFC.

I need a repainting scheme that cah handle a display that is a mixture of text and graphics.

I can handle repaint after scrolling if the display matter is either text or graphics, but once it is a mixture of both it becomes a challenge to me.

I handle text display by wiping the window clean, scanning through the buffer that holds the text and displaying the text that fit into the current page considering the scroll position.

I handle display of graphics by directing all out put to a memory dc and then using BitBlt to copy from the memory DC to the window DC.

My application hanles varied type of display with pre-determined format of which users cannot edit. Texts have varying sizes and style.

Seeing internet explorer, I just wander how it is able to handle a misture of text and bitmap seamlessly.

I once developed a formular to handle this display, but it produces some kind of wied display on scroll up.

Using the memory dc would hav been a perfect solution save for the fact that windows those not allow the size of the bitmap selected into it to exceed a certain limit.

Please, I need a after scroll repainting scheme that will handle a mixure of text and graphics seamlessly.

By graphics I meean JPEGS and .bmp bitmaps.

I use native programming and not MFC.

推荐答案

您必须使用
SetWindowOrgEx

将内存dc调整到滚动位置.这是滚动位置和更新矩形的偏移.
即:

to adjust your memory dc to the scroll position. This is the offset of the scrolling position and the update rect.
i.e.:

// scroll = 0,-100; rcclipbox = 20,20,100,100
// orgpos = -20,-120
SetWindowOrgEx(memdc,orgpos.x,orgpos.y,0);
// dib = 80x80 pixel
BitBlt(hdc,20,20,80,80,memdc,0,0,SRCCOPY);
// ...


问候.


这篇关于滚动重绘帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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