Click to See Complete Forum and Search --> : Need some help with StretchBlt and multiple monitors


Molog
November 29th, 2005, 02:49 PM
I have a problem where StretchBlt won't correctly display a bitmap on a secondary monitor.

The primary monitor is a standard monitor.
The secondary monitor is a grayscale dome from http://www.planar.com/ .
The OS is Windows 2000.

The problem is that is that only a small portion of the bitmap will be drawn. A small rectangle in the topleft. The bitmap is correctly scaled and everything.

The size of the rectangle drawn increases if I increase the resolution on the primary monitor. With a high enough resolution on the primary monitor I get the full bitmap displayed.

Having another window overlap the viewport will also cause the entire bitmap to be drawn. Having the viewport on two different monitors will also get the entire bitmap drawn. Setting the secondary monitor as primary will also solve the problem.

The problem seems to be that StretchBlt seems to use information from the primary monitor on how much to draw instead of the secondary monitor. I might be wrong here.

I read on MSDN that StretchBlt might fail under Windows XP and with multiple monitors and that you should use StretchDIBits to scale and then BitBlt to draw. This does work correctly, but is too slow for my needs. I want the speed of StretchBlt.

Can anybody help me with a possible solution, workaround or useful suggestion to solve this?

Molog
November 30th, 2005, 04:44 PM
It is apparently a video card bug. Nothing much to do against that.

The bug doesn't happen, when I write directly to monitor dc. I had this idea, that I write to monitor on place where window is. That works good, but I have the problem it overwrites everything in the window rectangle, including other windows.

Does anyone know a way to get the clipping region for a window in mfc?

Correct me if I'm wrong, I'm new to this kind of stuff.

bilm_ks
December 23rd, 2005, 03:18 PM
Maybe it helps:
dc->LPtoDP(&clientRect);