OSDN Git Service

BCMenu: Remove unused function DitherBlt()
authorTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 25 Jun 2016 10:37:46 +0000 (19:37 +0900)
committerTakashi Sawanaka <sdottaka@users.sourceforge.net>
Sat, 25 Jun 2016 10:37:46 +0000 (19:37 +0900)
Src/Common/BCMenu.cpp
Src/Common/BCMenu.h

index d82aed3..c30b76d 100644 (file)
@@ -1656,90 +1656,6 @@ LRESULT BCMenu::FindKeyboardShortcut(UINT nChar, UINT nFlags,
        return(0);
 }
 
-void BCMenu::DitherBlt (HDC hdcDest, int nXDest, int nYDest, int nWidth, 
-                        int nHeight, HBITMAP hbm, int nXSrc, int nYSrc,
-                                               COLORREF bgcolor)
-{
-       ASSERT(hdcDest && hbm);
-       ASSERT(nWidth > 0 && nHeight > 0);
-       
-       // Create a generic DC for all BitBlts
-       HDC hDC = CreateCompatibleDC(hdcDest);
-       ASSERT(hDC);
-       
-       if (hDC)
-       {
-               // Create a DC for the monochrome DIB section
-               HDC bwDC = CreateCompatibleDC(hDC);
-               ASSERT(bwDC);
-               
-               if (bwDC)
-               {
-                       // Create the monochrome DIB section with a black and white palette
-                       struct {
-                               BITMAPINFOHEADER bmiHeader; 
-                               RGBQUAD      bmiColors[2]; 
-                       } RGBBWBITMAPINFO = {
-                               
-                               {    // a BITMAPINFOHEADER
-                                       sizeof(BITMAPINFOHEADER),  // biSize 
-                                               nWidth,         // biWidth; 
-                                               nHeight,        // biHeight; 
-                                               1,            // biPlanes; 
-                                               1,            // biBitCount 
-                                               BI_RGB,         // biCompression; 
-                                               0,            // biSizeImage; 
-                                               0,            // biXPelsPerMeter; 
-                                               0,            // biYPelsPerMeter; 
-                                               0,            // biClrUsed; 
-                                               0            // biClrImportant; 
-                               },    
-                               {
-                                       { 0x00, 0x00, 0x00, 0x00 }, { 0xFF, 0xFF, 0xFF, 0x00 }
-                                       } 
-                       };
-                       VOID *pbitsBW;
-                       HBITMAP hbmBW = CreateDIBSection(bwDC,
-                               (LPBITMAPINFO)&RGBBWBITMAPINFO, DIB_RGB_COLORS, &pbitsBW, NULL, 0);
-                       ASSERT(hbmBW);
-                       
-                       if (hbmBW)
-                       {
-                               // Attach the monochrome DIB section and the bitmap to the DCs
-                               HBITMAP olddib = (HBITMAP)SelectObject(bwDC, hbmBW);
-                               HBITMAP hdcolddib = (HBITMAP)SelectObject(hDC, hbm);
-                               
-                               // BitBlt the bitmap into the monochrome DIB section
-                               BitBlt(bwDC, 0, 0, nWidth, nHeight, hDC, nXSrc, nYSrc, SRCCOPY);
-                               
-                               // Paint the destination rectangle in gray
-                               FillRect(hdcDest, CRect(nXDest, nYDest, nXDest + nWidth, nYDest +
-                                       nHeight), GetSysColorBrush(bgcolor));
-                               //SK: looks better on the old shell
-                               // BitBlt the black bits in the monochrome bitmap into COLOR_3DHILIGHT
-                               // bits in the destination DC
-                               // The magic ROP comes from the Charles Petzold's book
-                               HBRUSH hb = CreateSolidBrush(GetSysColor(COLOR_3DHILIGHT));
-                               HBRUSH oldBrush = (HBRUSH)SelectObject(hdcDest, hb);
-                               BitBlt(hdcDest,nXDest+1,nYDest+1,nWidth,nHeight,bwDC,0,0,0xB8074A);
-                               
-                               // BitBlt the black bits in the monochrome bitmap into COLOR_3DSHADOW
-                               // bits in the destination DC
-                               hb = CreateSolidBrush(GetSysColor(COLOR_3DSHADOW));
-                               DeleteObject(SelectObject(hdcDest, hb));
-                               BitBlt(hdcDest, nXDest, nYDest, nWidth, nHeight,bwDC,0,0,0xB8074A);
-                               DeleteObject(SelectObject(hdcDest, oldBrush));
-                               VERIFY(DeleteObject(SelectObject(bwDC, olddib)));
-                               SelectObject(hDC, hdcolddib);
-                       }
-                       
-                       VERIFY(DeleteDC(bwDC));
-               }
-               
-               VERIFY(DeleteDC(hDC));
-       }
-}
-
 void BCMenu::GetTransparentBitmap(CBitmap &bmp)
 {
        CDC ddc;
index d7f49da..425c8f3 100644 (file)
@@ -295,8 +295,6 @@ protected:
        void DrawItem_Win9xNT2000 (LPDRAWITEMSTRUCT lpDIS);
        BOOL Draw3DCheckmark(CDC *dc, const CRect& rc,BOOL bSelected,HBITMAP hbmCheck);
        void DrawItem_Theme (LPDRAWITEMSTRUCT lpDIS);
-       void DitherBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, 
-               int nHeight, HBITMAP hbm, int nXSrc, int nYSrc,COLORREF bgcolor);
        void DitherBlt2(CDC *drawdc, int nXDest, int nYDest, int nWidth, 
                int nHeight, CBitmap &bmp, int nXSrc, int nYSrc,COLORREF bgcolor);
        void DitherBlt3(CDC *drawdc, int nXDest, int nYDest, int nWidth,