I have added bitmap support to a text print/preview utility I recently converted from VB6 to PBWin. During the course of this implementation, I have found that the predefined '%mix_MaskSrc' style does not work as advertised with XPRINT statements that support styles. Works fine only with corresponding GRAPHIC statements. 
I compiled the same exact program (and used the same #include file) with PB 8.00 and it works as expected.
I of course
(and history.txt) of both compiler versions but cannot find any explanation on why styles support has changed since PB 8.00.
Here is a complete sample code I wrote only to demonstrate this issue:
My configuration: PbWin 8.04 + XP Home SP2 all updates. I have checked this with a Canon I550 printer and, to save trees
, with PdfCreator virtual printer.
What am I missing here?
lease:

I compiled the same exact program (and used the same #include file) with PB 8.00 and it works as expected.
I of course

Here is a complete sample code I wrote only to demonstrate this issue:
Code:
#PBFORMS CREATED V1.51 #COMPILE EXE #DIM ALL #PBFORMS BEGIN INCLUDES %USEMACROS = 1 #INCLUDE "WIN32API.INC" #PBFORMS END INCLUDES #PBFORMS BEGIN CONSTANTS %IDD_DIALOG1 = 101 %IDC_GRAPHIC = 1001 %IDC_LABEL1 = 1002 %IDC_CBSTYLE = 1003 %IDC_PRINT = 1004 %IDCANCEL = 2 %DEST_SCREEN = 1 %DEST_PRINTER = 2 #PBFORMS END CONSTANTS DECLARE CALLBACK FUNCTION ShowDIALOG1Proc() DECLARE FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG #PBFORMS DECLARATIONS FUNCTION PBMAIN() ShowDIALOG1 %HWND_DESKTOP END FUNCTION SUB Draw_Boxes(DestDevice AS LONG,hDlg AS LONG) LOCAL hBmp1 AS DWORD,hBmp2 AS DWORD LOCAL bWidth AS LONG ,bHeight AS LONG ,BStyle AS LONG ' Retrieve current style selection: CONTROL SEND hDlg, %IDC_CBSTYLE, %CB_GETCURSEL, 0,0 TO Bstyle Bstyle=CHOOSE&(Bstyle+1&,%MIX_NOTMERGESRC, _ %MIX_NOTCOPYSRC, _ %MIX_MASKSRCNOT,_ %MIX_XORSRC, _ %MIX_MASKSRC, _ %MIX_MERGENOTSRC, _ %MIX_COPYSRC, _ %MIX_MERGESRC) ' Need a larger size for most printers: IF DestDevice=%DEST_SCREEN THEN bWidth=160 :bHeight=80 ELSE bWidth=1600:bHeight=800 END IF ' Create bitmap 1 GRAPHIC BITMAP NEW bWidth, bHeight TO hBmp1 GRAPHIC ATTACH hBmp1,0 GRAPHIC BOX (0,0)-(bWidth-1,bHeight-1),0,0,%YELLOW,0 ' Create bitmap 2 GRAPHIC BITMAP NEW bWidth, bHeight TO hBmp2 GRAPHIC ATTACH hBmp2,0 GRAPHIC BOX (0,0)-(bWidth-1,bHeight-1),0,0,%BLUE,0 IF DestDevice=%DEST_SCREEN THEN ' Switch to graphic control GRAPHIC ATTACH hDlg,%IDC_GRAPHIC, REDRAW GRAPHIC COLOR -1, %WHITE GRAPHIC CLEAR ' Show bitmaps GRAPHIC COPY hBmp1,0 TO (10 ,10 ),BStyle GRAPHIC COPY hBmp2,0 TO (bWidth/2+10 ,bHeight/2+10 ),BStyle GRAPHIC REDRAW ELSE XPRINT ATTACH CHOOSE IF XPRINT$="" THEN BEEP:EXIT SUB ' Print bitmaps XPRINT COPY hBmp1,0 TO (100,100),BStyle XPRINT COPY hBmp2,0 TO (bWidth/2+100,bHeight/2+100),BStyle XPRINT FORMFEED XPRINT CLOSE END IF ' Cleanup GRAPHIC ATTACH hBmp1,0 GRAPHIC BITMAP END GRAPHIC ATTACH hBmp2,0 GRAPHIC BITMAP END END SUB CALLBACK FUNCTION ShowDIALOG1Proc() SELECT CASE AS LONG CBMSG CASE %WM_INITDIALOG CALL Draw_Boxes(%DEST_SCREEN,CBHNDL) CONTROL SET FOCUS CBHNDL,%IDC_CBSTYLE CASE %WM_COMMAND ' Process control notifications SELECT CASE AS LONG CBCTL CASE %IDC_CBSTYLE SELECT CASE CBCTLMSG CASE %CBN_SELCHANGE CALL Draw_Boxes(%DEST_SCREEN,CBHNDL) END SELECT CASE %IDC_PRINT IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN CALL Draw_Boxes(%DEST_PRINTER,CBHNDL) END IF CASE %IDCANCEL IF CBCTLMSG = %BN_CLICKED OR CBCTLMSG = 1 THEN DIALOG END CBHNDL, 0 END IF END SELECT END SELECT END FUNCTION FUNCTION ShowDIALOG1(BYVAL hParent AS DWORD) AS LONG #PBFORMS BEGIN DIALOG %IDD_DIALOG1->-> LOCAL hDlg AS DWORD DIALOG NEW PIXELS, hParent, "Test Pixel Style", 250, 170, 290, 220, %WS_POPUP OR _ %WS_BORDER OR %WS_DLGFRAME OR %WS_CAPTION OR %WS_SYSMENU OR _ %WS_MINIMIZEBOX OR %WS_CLIPSIBLINGS OR %WS_VISIBLE OR %DS_MODALFRAME OR _ %DS_SETFOREGROUND OR %DS_CENTER OR %DS_3DLOOK OR %DS_NOFAILCREATE OR _ %DS_SETFONT, %WS_EX_CONTROLPARENT OR %WS_EX_LEFT OR %WS_EX_LTRREADING OR _ %WS_EX_RIGHTSCROLLBAR, TO hDlg CONTROL ADD LABEL, hDlg, %IDC_LABEL1, "Style: ", 15, 10, 67, 20, _ %WS_CHILD OR %WS_VISIBLE OR %SS_RIGHT OR %SS_CENTERIMAGE, %WS_EX_LEFT OR _ %WS_EX_LTRREADING CONTROL ADD COMBOBOX, hDlg, %IDC_CBSTYLE, , 80, 10, 196, 200, %WS_CHILD _ OR %WS_VISIBLE OR %WS_TABSTOP OR %WS_VSCROLL OR %CBS_DROPDOWNLIST, _ %WS_EX_LEFT OR %WS_EX_LTRREADING OR %WS_EX_RIGHTSCROLLBAR CONTROL ADD GRAPHIC, hDlg, %IDC_GRAPHIC, "", 15, 35, 260, 140, %WS_CHILD OR _ %WS_VISIBLE OR %WS_BORDER CONTROL ADD BUTTON, hDlg, %IDC_PRINT, "Print", 110, 187, 75, 25 CONTROL ADD BUTTON, hDlg, %IDCANCEL, "Exit", 200, 187, 75, 25 COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_NotMergeSrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_NotCopySrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_MaskSrcNot" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_XorSrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_MaskSrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_MergeNotSrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_CopySrc" COMBOBOX ADD hDlg, %IDC_CBSTYLE, "%mix_MergeSrc" COMBOBOX SELECT hDlg, %IDC_CBSTYLE,5 #PBFORMS END DIALOG DIALOG SHOW MODAL hDlg, CALL ShowDIALOG1Proc #PBFORMS BEGIN CLEANUP %IDD_DIALOG1 #PBFORMS END CLEANUP END FUNCTION

What am I missing here?

Comment