- DWORD pGdi;
- void InitGdi()
- {
- Gdiplus::GdiplusStartupInput gdiStartInput;
- Gdiplus::GdiplusStartup(&pGdi, &gdiStartInput, NULL);
- }
- void DeInitGdi()
- {
- Gdiplus::GdiplusShutdown(pGdi);
- }
- Gdiplus::Color GdiCreateColor(int a, int r, int g, int b)
- {
- return Gdiplus::Color::Color(a, r, g, b);
- }
- void GdiDrawLine(Gdiplus::Color color, int x1, int y1, int x2, int y2, float penwidth, HDC hdc)
- {
- Gdiplus::Graphics gdiGraphic(hdc);
- Gdiplus::Pen gdiPen(Gdiplus::Color(color), penwidth);
- gdiGraphic.DrawLine(&gdiPen, x1, y1, x2, y2);
- gdiGraphic.ReleaseHDC(hdc);
- }
- void GdiDrawRect(Gdiplus::Color color, int x1, int y1, int rectw, int recth, float penwidth, HDC hdc)
- {
- Gdiplus::Graphics gdiGraphic(hdc);
- Gdiplus::Pen gdiPen(Gdiplus::Color(color), penwidth);
- gdiGraphic.DrawRectangle(&gdiPen, x1, y1, rectw, recth);
- gdiGraphic.ReleaseHDC(hdc);
- }
- void GdiDrawEllipse(Gdiplus::Color color, int x, int y, int ellipsew, int ellipseh, float penwidth, HDC hdc)
- {
- Gdiplus::Graphics gdiGraphic(hdc);
- Gdiplus::Pen gdiPen(Gdiplus::Color(color), penwidth);
- gdiGraphic.DrawEllipse(&gdiPen, x, y, ellipsew, ellipseh);
- gdiGraphic.ReleaseHDC(hdc);
- }
Undefined
By: Guest | Date: Nov 21 2009 23:48 | Format: None | Expires: never | Size: 1.15 KB | Hits: 887
Latest pastes
55 minutes ago
10 hours ago
1 days ago
2 days ago
2 days ago