Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fills triangle with gradient brush
- void GradientTriangle( HDC MemDC,
- LONG x1, LONG y1, LONG x2, LONG y2, LONG x3, LONG y3,
- COLORREF top, COLORREF bottom )
- {
- TRIVERTEX vertex[3];
- vertex[0].x = x1;
- vertex[0].y = y1;
- vertex[0].Red = GetRValue(bottom) << 8;
- vertex[0].Green = GetGValue(bottom) << 8;
- vertex[0].Blue = GetBValue(bottom) << 8;
- vertex[0].Alpha = 0x0000;
- vertex[1].x = x2;
- vertex[1].y = y2;
- vertex[1].Red = GetRValue(top) << 8;
- vertex[1].Green = GetGValue(top) << 8;
- vertex[1].Blue = GetBValue(top) << 8;
- vertex[1].Alpha = 0x0000;
- vertex[2].x = x3;
- vertex[2].y = y3;
- vertex[2].Red = GetRValue(bottom) << 8;
- vertex[2].Green = GetGValue(bottom) << 8;
- vertex[2].Blue = GetBValue(bottom) << 8;
- vertex[2].Alpha = 0x0000;
- // Create a GRADIENT_TRIANGLE structure that
- // references the TRIVERTEX vertices.
- GRADIENT_TRIANGLE gTriangle;
- gTriangle.Vertex1 = 0;
- gTriangle.Vertex2 = 1;
- gTriangle.Vertex3 = 2;
- // Draw a shaded triangle.
- GradientFill( MemDC, vertex, 3, &gTriangle, 1, GRADIENT_FILL_TRIANGLE);
- }
- // draw the window's footer ( "status bar" )
- void drawFooter( HDC MemDC, RECT r, COLORREF top, COLORREF bottom )
- {
- // bottom triangle
- GradientTriangle( MemDC,
- r.right, r.bottom,
- ( r.right - r.left ) / 2,
- r.bottom - r.top - 15,
- r.left,
- r.bottom,
- top, bottom );
- // upper triangle
- GradientTriangle( MemDC,
- r.right, r.bottom - r.top - 30,
- ( r.right - r.left ) / 2,
- r.bottom - r.top - 15,
- r.left,
- r.bottom - r.top - 30,
- top, bottom );
- // left triangle
- GradientTriangle( MemDC,
- r.left, r.bottom,
- ( r.right - r.left ) / 2,
- r.bottom - r.top - 15,
- r.left,
- r.bottom - r.top - 30,
- top, bottom );
- // right triangle
- GradientTriangle( MemDC,
- r.right,
- r.bottom - r.top - 30,
- ( r.right - r.left ) / 2,
- r.bottom - r.top - 15,
- r.right,
- r.bottom,
- top, bottom );
- // draw icon
- DrawIconEx( MemDC, r.left, r.bottom - r.top - 30,
- hiAdmin, // a global variable for icon
- 30, 30, NULL, NULL, DI_NORMAL );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement