Changeset 3401
- Timestamp:
- 08/14/04 09:46:41 (4 years ago)
- Files:
-
- branches/2.1/src/ChangeLog.Meadow (modified) (1 diff)
- branches/2.1/src/mw32term.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/2.1/src/ChangeLog.Meadow
r3398 r3401 1 2004-08-14 MIYOSHI Masanori <miyoshi@meadowy.org> 2 3 * mw32term.c (mw32_draw_image_foreground): Draw an image with 4 offscreen rendering. 5 1 6 2004-08-13 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 7 branches/2.1/src/mw32term.c
r3387 r3401 3917 3917 if (hbmpmask) 3918 3918 { 3919 HDC hdc_src = CreateCompatibleDC (s->hdc); 3920 if (hdc_src) 3919 HDC hdc_fg = CreateCompatibleDC (s->hdc); 3920 HDC hdc_bg = CreateCompatibleDC (s->hdc); 3921 if (hdc_fg && hdc_bg) 3921 3922 { 3922 HBITMAP hsrc = CreateCompatibleBitmap (s->hdc, 3923 s->img->width, 3924 s->img->height); 3925 if (hsrc) 3923 int w = s->img->width; 3924 int h = s->img->height; 3925 HBITMAP hfg = CreateCompatibleBitmap (s->hdc, w, h); 3926 HBITMAP hbg = CreateCompatibleBitmap (s->hdc, w, h); 3927 if (hfg && hbg) 3926 3928 { 3927 HGDIOBJ hsrc_old = SelectObject (hdc_src, hsrc); 3929 HGDIOBJ hfg_old = SelectObject (hdc_fg, hfg); 3930 HGDIOBJ hbg_old = SelectObject (hdc_bg, hbg); 3928 3931 3929 /* Fill the background area with black mask. */ 3932 /* Build up background */ 3933 BitBlt (hdc_bg, 0, 0, w, h, s->hdc, x, y, SRCCOPY); 3930 3934 holdbmp = SelectObject (hdcimg, hbmpmask); 3931 BitBlt (s->hdc, x, y, s->img->width, s->img->height, 3932 hdcimg, 0, 0, SRCAND); 3933 /* Fill the foreground area with white mask. */ 3934 BitBlt (hdc_src, 0, 0, s->img->width, s->img->height, 3935 hdcimg, 0, 0, NOTSRCCOPY); 3936 /* Merge image with foreground by bitwise-and. */ 3935 BitBlt (hdc_bg, 0, 0, w, h, hdcimg, 0, 0, SRCAND); 3936 /* Build up foreground */ 3937 BitBlt (hdc_fg, 0, 0, w, h, hdcimg, 0, 0, NOTSRCCOPY); 3937 3938 SelectObject (hdcimg, hbmp); 3938 BitBlt (hdc_ src, 0, 0, s->img->width, s->img->height,3939 hdcimg, 0, 0, SRCAND);3940 /* Last merge background with foreground by3941 bitwise-or.*/3942 BitBlt (s->hdc, x, y, s->img->width, s->img->height,3943 hdc_src, 0, 0, SRCPAINT);3944 SelectObject (hdc_ src, hsrc_old);3939 BitBlt (hdc_fg, 0, 0, w, h, hdcimg, 0, 0, SRCAND); 3940 /* Merge background and foreground */ 3941 BitBlt (hdc_fg, 0, 0, w, h, hdc_bg, 0, 0, SRCPAINT); 3942 /* Copy the result to HDC */ 3943 BitBlt (s->hdc, x, y, w, h, hdc_fg, 0, 0, SRCCOPY); 3944 SelectObject (hdc_fg, hfg_old); 3945 SelectObject (hdc_bg, hbg_old); 3945 3946 } 3946 DeleteDC (hdc_src);3947 DeleteObject (hsrc);3947 if (hfg) DeleteObject (hfg); 3948 if (hbg) DeleteObject (hbg); 3948 3949 } 3950 if (hdc_fg) DeleteDC (hdc_fg); 3951 if (hdc_bg) DeleteDC (hdc_bg); 3949 3952 } 3950 3953 else
