Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CreteCarRgn(HDC hDC, HRGN& hRgn, int x, int y, int width, int height, double angle)
- {
- //Ellipse(hDC, x, y, x + width, y + height);
- //begin
- BeginPath(hDC);
- //rotate
- //make region
- MoveToEx(hDC, (int)RotateX(x, y, angle), (int)RotateY(x, y, angle), NULL);
- LineTo(hDC, (int)RotateX(x, y + 0.8*height, angle), (int)RotateY(x, y + 0.8*height, angle));
- LineTo(hDC, (int)RotateX(x + width, y + 0.8*height, angle), (int)RotateY(x + width, y + 0.8*height, angle));
- LineTo(hDC, (int)RotateX(x + width, y, angle), (int)RotateY(x + width, y, angle));
- LineTo(hDC, (int)RotateX(x, y, angle), (int)RotateY(x, y, angle));
- AngleArc(hDC, (int)RotateX(x, y + 0.9*height, angle), (int)RotateY(x, y + 0.9*height, angle), 0.1*height, 0, 360);
- //AngleArc(hDC, (int)RotateX(x + width, y + 0.9*height, angle), (int)RotateY(x + width, y + 0.9*height, angle), 0.1*height, 0, 360);
- //Ellipse(hDC, (int)RotateX(x, y + 0.8*height, angle), (int)RotateY(x, y + 0.8*height, angle), (int)RotateX(x + 0.2*width, y + height, angle), (int)RotateY(x + 0.2*width, y + height, angle));
- //Ellipse(hDC, x + 0.8*width, y + 0.8*height, x + width, y + height);
- CloseFigure(hDC);
- //end
- EndPath(hDC);
- hRgn = PathToRegion(hDC);
- }
Advertisement
Add Comment
Please, Sign In to add comment