Qt:
Static char fobitsarray [53] [8] =
{
{0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff}, // 01
{0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef },
{0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe },
{0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f },
{0xf7, 0xf7, 0xf7, 0xf7, 0x0, 0xf7, 0xf7, 0xf7 },
{0xde, 0xed, 0xf3, 0xf3, 0xed, 0xde, 0x3f, 0x3f },
{0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0x7f },
{0xff, 0xf7, 0xff, 0x7f, 0xff, 0xf7, 0xff, 0x7f },
{0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff, 0x77 },
{0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77}, // 10
{0x55, 0xEE, 0x55, 0xbb, 0x55, 0xEE, 0x55, 0xbb },
{0x55, 0xaa, 0x55, 0xba, 0x55, 0xaa, 0x55, 0xab },
{0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa },
{0x11, 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa },
{0x88 },
{0x0, 0x44, 0x0 0x11, 0x0 0x44, 0x0x11 },
{0x4, 0x0 0x40, 0x0, 0x4, 0x0 0x40, 0x0 },
{0x0, 0x2, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0 },
{0xbb, 0xdd, 0xEE, 0x77, 0xbb, 0xdd, 0xEE, 0x77 },
{0xdd, 0xbb, 0x77, 0xEE, 0xdd, 0xbb, 0x77, 0xEE}, // 20
{0xcc, 0x66,0x33,0x99, 0xcc, 0x66,0x33,0x99 },
{0xcc, 0x99,0x33,0x66, 0xcc, 0x99,0x33,0x66 },
{0x3e, 0x1f, 0x8f, 0xc7, 0xe3, 0xf1, 0xf8, 0x7c },
{0x7c, 0xf8, 0xf1, 0xe3, 0xc7, 0x8f, 0x1f, 0x3e },
{0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb },
{0xff, 0x0, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff },
{0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
{0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0 },
{0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66 },
{0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff}, // 30
{0xff, 0xff, 0xff, 0xff, 0x77, 0xbb, 0xdd, 0xEE },
{0xff, 0xff, 0xff, 0xff, 0xEE, 0xdd, 0xbb, 0x77 },
{0xff, 0xff, 0xff, 0x78, 0xff, 0xff, 0xff, 0x87 },
{0xfb, 0xfb, 0xfb, 0xfb, 0xbf, 0xbf, 0xbf, 0xbf },
{0xfe, 0xdf, 0xfb, 0xbf, 0xfd, 0xff, 0x7f, 0xf7 },
{0x39,0x27, 0xe7, 0x7e, 0x72,0X93, 0x9f, 0xf9 },
{0xed, 0xde, 0x3f, 0xf3, 0xed, 0xde, 0x3f, 0xf3 },
{0xf3, 0x6d, 0x9f, 0xff, 0xf3, 0x6d, 0x9f, 0xff },
{0xfe, 0xfc, 0x7b, 0xb7, 0xcf, 0xdf, 0xbf, 0x7f },
{0xfb, 0xfb, 0xfb, 0x0, 0x7f, 0x7f, 0x7f, 0x0}, // 40
{0xfb, 0x77, 0xab, 0xdd, 0xea, 0x77, 0xae, 0xdd },
{0xf, 0x55, 0xaa, 0x55, 0xaf, 0xf, 0xf, 0xf },
{0xff, 0xfb, 0xfd, 0xfb, 0xff, 0xdf, 0xbf, 0xdf },
{0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x55 },
{0x77, 0xff, 0xfd, 0xff, 0x77, 0xff, 0xdf, 0xff },
{0xde, 0x3f, 0xcf, 0xf7, 0xfb, 0xfb, 0xf3, 0xed },
{0x66, 0x99, 0x66, 0x99 },
{0 x, 0 x, 0 x, 0 x, 0x7 },
{0 x, 0 x, 0x77, 0 x, 0 x },
{0x33, 0xcc, 0xcc, 0x33,0x33, 0xcc, 0xcc, 0x33}, // 50
{0xf0, 0xf0, 0xf0, 0xf0, 0xf, 0xf, 0xf, 0xf },
{0xEE, 0xf5, 0xfb, 0xf5, 0xEE, 0x5f, 0xbf, 0x5f },
{0xff, 0xef, 0xc7, 0x83, 0x1, 0x83, 0xc7, 0xef },
};
Qpixmap qtlibgraph: getpatternbitmap (INT nindex)
{
Assert (nindex> = 0 & nindex <41 );
If (m_brushstate.m_bmarray = NULL)
{
M_brushstate.m_bmarray = new qpixmap [41];
}
If (m_brushstate.m_bmarray [nindex]. isnull ())
{
Char bitsbuf [8] [8];
Memcpy (bitsbuf, fobitsarray [nindex], 8*8 );
Qimage Bitmap (const uchar *) bitsbuf, 8, 8, 1, qimage: format_mono );
M_brushstate.m_bmarray [nindex] = qpixmap: fromimage (Bitmap );
}
Return m_brushstate.m_bmarray [nindex];
}
If (m_nbrushtype <42)
{
Long lbpattern = m_nbrushtype-3;
Qpixmap pixmap = getpatternbitmap (lbpattern );
Colorref CLR = getfgcolor ();
R = getrvalue (CLR );
G = getgvalue (CLR );
B = getbvalue (CLR );
Pbrush-> setcolor (qcolor (R, G, B ));
Pbrush-> setstyle (QT: texturepattern );
Pbrush-> settexture (pixmap );
}
Else
{
Pbrush-> setstyle (QT: nobrush );
}
Qrect (rcpos. Left, rcpos. Top, rcpos. Width (), rcpos. Height ());
PDC-> drawrect (qrect );
Crect rcclient = rcpos;
Draw3drect (PDC, rcclient. Left, rcclient. Top,
Rcclient. Width (), rcclient. Height (), gfxdata. m_crbtnshadow, RGB (255,255,255 ));
Rcclient. deflaterect (1, 1, 1 );
Draw3drect (PDC, rcclient. Left, rcclient. Top,
Rcclient. Width (), rcclient. Height (), RGB (0, 0), gfxdata. m_crbtnface );
MFC:
Static word fobitsarray [53] [8] =
{
{0xff, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff, 0xff}, // 01
{0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef },
{0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe },
{0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f },
{0xf7, 0xf7, 0xf7, 0xf7, 0x0, 0xf7, 0xf7, 0xf7 },
{0xde, 0xed, 0xf3, 0xf3, 0xed, 0xde, 0x3f, 0x3f },
{0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0x7f },
{0xff, 0xf7, 0xff, 0x7f, 0xff, 0xf7, 0xff, 0x7f },
{0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff, 0x77 },
{0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77, 0xdd, 0x77}, // 10
{0x55, 0xEE, 0x55, 0xbb, 0x55, 0xEE, 0x55, 0xbb },
{0x55, 0xaa, 0x55, 0xba, 0x55, 0xaa, 0x55, 0xab },
{0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa },
{0x11, 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa },
{0x88 },
{0x0, 0x44, 0x0 0x11, 0x0 0x44, 0x0x11 },
{0x4, 0x0 0x40, 0x0, 0x4, 0x0 0x40, 0x0 },
{0x0, 0x2, 0x0, 0x0, 0x0, 0x20, 0x0, 0x0 },
{0xbb, 0xdd, 0xEE, 0x77, 0xbb, 0xdd, 0xEE, 0x77 },
{0xdd, 0xbb, 0x77, 0xEE, 0xdd, 0xbb, 0x77, 0xEE}, // 20
{0xcc, 0x66,0x33,0x99, 0xcc, 0x66,0x33,0x99 },
{0xcc, 0x99,0x33,0x66, 0xcc, 0x99,0x33,0x66 },
{0x3e, 0x1f, 0x8f, 0xc7, 0xe3, 0xf1, 0xf8, 0x7c },
{0x7c, 0xf8, 0xf1, 0xe3, 0xc7, 0x8f, 0x1f, 0x3e },
{0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb },
{0xff, 0x0, 0xff, 0xff, 0xff, 0x0, 0xff, 0xff },
{0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa },
{0xff, 0x0, 0xff, 0x0, 0xff, 0x0, 0xff, 0x0 },
{0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66,0x66 },
{0xff, 0x0, 0x0, 0xff, 0xff, 0x0, 0x0, 0xff}, // 30
{0xff, 0xff, 0xff, 0xff, 0x77, 0xbb, 0xdd, 0xEE },
{0xff, 0xff, 0xff, 0xff, 0xEE, 0xdd, 0xbb, 0x77 },
{0xff, 0xff, 0xff, 0x78, 0xff, 0xff, 0xff, 0x87 },
{0xfb, 0xfb, 0xfb, 0xfb, 0xbf, 0xbf, 0xbf, 0xbf },
{0xfe, 0xdf, 0xfb, 0xbf, 0xfd, 0xff, 0x7f, 0xf7 },
{0x39,0x27, 0xe7, 0x7e, 0x72,0X93, 0x9f, 0xf9 },
{0xed, 0xde, 0x3f, 0xf3, 0xed, 0xde, 0x3f, 0xf3 },
{0xf3, 0x6d, 0x9f, 0xff, 0xf3, 0x6d, 0x9f, 0xff },
{0xfe, 0xfc, 0x7b, 0xb7, 0xcf, 0xdf, 0xbf, 0x7f },
{0xfb, 0xfb, 0xfb, 0x0, 0x7f, 0x7f, 0x7f, 0x0}, // 40
{0xfb, 0x77, 0xab, 0xdd, 0xea, 0x77, 0xae, 0xdd },
{0xf, 0x55, 0xaa, 0x55, 0xaf, 0xf, 0xf, 0xf },
{0xff, 0xfb, 0xfd, 0xfb, 0xff, 0xdf, 0xbf, 0xdf },
{0xff, 0x7f, 0xff, 0x7f, 0xff, 0x7f, 0xff, 0x55 },
{0x77, 0xff, 0xfd, 0xff, 0x77, 0xff, 0xdf, 0xff },
{0xde, 0x3f, 0xcf, 0xf7, 0xfb, 0xfb, 0xf3, 0xed },
{0x66, 0x99, 0x66, 0x99 },
{0 x, 0 x, 0 x, 0 x, 0x7 },
{0 x, 0 x, 0x77, 0 x, 0 x },
{0x33, 0xcc, 0xcc, 0x33,0x33, 0xcc, 0xcc, 0x33}, // 50
{0xf0, 0xf0, 0xf0, 0xf0, 0xf, 0xf, 0xf, 0xf },
{0xEE, 0xf5, 0xfb, 0xf5, 0xEE, 0x5f, 0xbf, 0x5f },
{0xff, 0xef, 0xc7, 0x83, 0x1, 0x83, 0xc7, 0xef },
};
Cbitmap * qtlibgraph: getpatternbitmap (INT nindex)
{
Assert (nindex> = 0 & nindex <41 );
If (m_brushstate.m_bmarray [nindex]. getsafehandle () = 0)
{
Verify (m_brushstate.m_bmarray [nindex]. createbitmap (8, (const void *) fobitsarray [nindex]);
}
Return & m_brushstate.m_bmarray [nindex];
}
If (m_nbrushtype <42)
{
Logbrush Lb;
LB. lbstyle = bs_pattern;
Long lbpattern = m_nBrushType-3;
LB. lbhatch = (INT) getpatternbitmap (lbpattern)-> getsafehandle ();
LB. lbcolor = getfgcolor ();
Pbrush-> createbrushindirect (& Lb );
}
Else
{
Pbrush-> createstockobject (null_brush );
}
If (m_nbrushtype <42)
{
PDC-> rectangle (& rcpos );
Crect rcclient = rcpos;
PDC-> draw3drect (rcclient, gfxdata. m_crbtnshadow, RGB (255,255,255 ));
Rcclient. deflaterect (1, 1, 1 );
PDC-> draw3drect (rcclient, RGB (0, 0), gfxdata. m_crbtnface );
}