Link to home
Start Free TrialLog in
Avatar of DMTrump
DMTrumpFlag for United States of America

asked on

StretchBlt difficulty with forms with TransparentColor = True

I am using the StretchBlt windows function to create a magnifier that follows the mouse in one of my applications,  However it does not "see" a Delphi form that has the TransparentColor property set to true.

I discovered long ago that when using BitBlt to take a screenshot I had to combine SCRCOPY with CAPTUREBLT  ($4000000) like so: SRCCOPY or CAPTUREBLT in order to "see" such forms in my screenshot.
 BitBlt(DestBitmap.Canvas.Handle, 0, 0, DestBitmap.Width, DestBitmap.Height, DC, ox, oy, SRCCOPY or CAPTUREBLT);
(That sees forms with TransparentColor=True)

However doing that with StretchBlt does not have the same effect:
  StretchBlt(Canvas.Handle, 0, 0, Width, Height, FDC,
    P.X, P.Y, SrcWidth, SrcHeight, SRCCOPY or CAPTUREBLT);
Does not see forms with TransparentColor = true.

Any suggestions on how to make that work?  Wheat I need to be able to do is see the portion of the form or of an image on the form that is in a color <other> than the defined transparent color.


SOLUTION
Avatar of jimyX
jimyX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DMTrump

ASKER

I assume you meant SRCAND?  Yes I had tried it - just gor a black image.
SRCCAND is not recognized.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of DMTrump

ASKER

I'd still be glad to here a better solution than the one I arrived at and will award the remaining 450 points for it  Meanwhile, if anyone arrives here looking for a solution to the problem I posed - my method DOES work <BG>
Avatar of DMTrump

ASKER

I gave 50 points to jimyX for at least trying to help - even though I figured out an acceptable solution on my own.
My solution may not be the only one or the best one but it works.