00103 {
00104
BOOL fSuccess =
FALSE;
00105
00106
00107
00108
00109
00110
if (pcur->CURSORF_flags &
CURSORF_ACON) {
00111
00112
if ((
int)istepIfAniCur >= ((
PACON)pcur)->cicur) {
00113 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING,
"DrawIconEx, icon step out of range.");
00114
goto Done;
00115 }
00116
00117 pcur = ((
PACON)pcur)->aspcur[((
PACON)pcur)->aicur[istepIfAniCur]];
00118 }
00119
00120
00121
00122
00123 cx =
GetCWidth(cx, diFlags, pcur->cx);
00124
cy =
GetCHeight(cy, diFlags, (pcur->cy / 2));
00125
00126
if (hbr) {
00127
00128 HBITMAP hbmpT =
NULL;
00129 HDC hdcT;
00130 HBITMAP hbmpOld;
00131 POLYPATBLT PolyData;
00132
00133
if (hdcT = GreCreateCompatibleDC(hdc)) {
00134
00135
if (hbmpT = GreCreateCompatibleBitmap(hdc, cx, cy)) {
00136 POINT pt;
00137
BOOL bRet;
00138
00139 hbmpOld = GreSelectBitmap(hdcT, hbmpT);
00140
00141
00142
00143
00144
00145 bRet = GreGetBrushOrg(hdc, &pt);
00146
00147
00148
00149
00150
if (bRet !=
TRUE) {
00151 RIPMSG0(RIP_WARNING,
"DrawIconEx, GreGetBrushOrg failed.");
00152 }
00153
00154 bRet = GreSetBrushOrg(hdcT, pt.x, pt.y, NULL);
00155
if (bRet !=
TRUE) {
00156 RIPMSG0(RIP_WARNING,
"DrawIconEx, GreSetBrushOrg failed.");
00157 }
00158
00159 PolyData.x = 0;
00160 PolyData.y = 0;
00161 PolyData.cx = cx;
00162 PolyData.cy =
cy;
00163 PolyData.BrClr.hbr = hbr;
00164
00165 bRet = GrePolyPatBlt(hdcT, PATCOPY, &PolyData, 1, PPB_BRUSH);
00166
if (bRet !=
TRUE) {
00167 RIPMSG0(RIP_WARNING,
"DrawIconEx, GrePolyPatBlt failed.");
00168 }
00169
00170
00171
00172
00173
BltIcon(hdcT, 0, 0, cx, cy, ghdcMem, pcur, TRUE, SRCAND);
00174
BltIcon(hdcT, 0, 0, cx, cy, ghdcMem, pcur, FALSE, SRCINVERT);
00175
00176
00177
00178
00179 GreBitBlt(hdc, x, y, cx, cy, hdcT, 0, 0, SRCCOPY, (COLORREF)-1);
00180
00181 GreSelectBitmap(hdcT, hbmpOld);
00182
00183 bRet = GreDeleteObject(hbmpT);
00184
if (bRet !=
TRUE) {
00185 RIPMSG0(RIP_WARNING,
"DrawIconEx, GreDeleteObject failed. Possible Leak");
00186 }
00187
00188 fSuccess =
TRUE;
00189 }
00190
00191 GreDeleteDC(hdcT);
00192 }
00193
00194 }
else {
00195
00196
if (diFlags & DI_MASK) {
00197
00198
BltIcon(hdc,
00199 x,
00200 y,
00201 cx,
00202 cy,
00203 ghdcMem,
00204 pcur,
00205 TRUE,
00206 ((diFlags & DI_IMAGE) ? SRCAND : SRCCOPY));
00207 }
00208
00209
if (diFlags & DI_IMAGE) {
00210
00211
BltIcon(hdc,
00212 x,
00213 y,
00214 cx,
00215 cy,
00216 ghdcMem,
00217 pcur,
00218 FALSE,
00219 ((diFlags & DI_MASK) ? SRCINVERT : SRCCOPY));
00220 }
00221
00222 fSuccess =
TRUE;
00223 }
00224
00225 Done:
00226
00227
return fSuccess;
00228 }