On 7/2/04 2:54 PM, "Frank C" <lists at si-co dot com> wrote:
> Where "rgbPic" and "maskPic" are two 32bit REALpicture's created with
> REALBuildPictureFromBuffer. Like I said, the mask is properly drawn
> into rgbPic's mask property so this apparently works, but rgbPic
> doesn't blit masked when drawn in RB. A similar approach using
> REALSelectGraphics works fine on Mac OS.
Maybe I'm not understanding what you're trying to accomplish, but here's
something that works for me (as far as you've explained your problem, it
seems to me this is what you're trying to do):
REALpicture GetPicWithMask( REALcontrolInstance instance, long width, long
height, REALpicture rgbPic, REALpicture maskPic )
{
#if TARGET_WIN32
REALpicture pic = REALNewPicture( width, height, 32 );
Rect bounds;
bounds.left = 0;
bounds.top = 0;
bounds.right = width;
bounds.bottom = height;
REALgraphics graphics = REALGetPictureGraphics( pic );
HDC theDC = REALGraphicsDC( graphics );
REALDrawPicturePrimitive( theDC, rgbPic, &bounds, 0 );
REALUnlockObject((REALobject)graphics);
REALpicture mask = REALGetPictureMask( pic, true );
graphics = REALGetPictureGraphics( mask );
theDC = REALGraphicsDC( graphics );
REALDrawPicturePrimitive( theDC, maskPic, &bounds, 0 );
REALUnlockObject((REALobject)graphics);
REALUnlockObject( (REALobject)mask );
return pic;
#endif
return nil;
}
Regards,
William Yu
william at realsoftware dot com
_______________________________________________
Unsubscribe or switch delivery mode:
<http://support.realsoftware.com/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>
|