Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

1 solution

You must use
SetWindowOrgEx
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);
// ...

Regards.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900