mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-31 06:30:52 +00:00
new function
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@317 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -82,6 +82,7 @@ MWDECL MwLL MwLLCreate(MwLL parent, int x, int y, int width, int height);
|
||||
MWDECL void MwLLDestroy(MwLL handle);
|
||||
|
||||
MWDECL void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color);
|
||||
MWDECL void MwLLLine(MwLL handle, MwPoint* points, MwLLColor color);
|
||||
|
||||
MWDECL MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b);
|
||||
MWDECL void MwLLFreeColor(MwLLColor color);
|
||||
|
||||
@@ -239,6 +239,16 @@ void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color
|
||||
free(p);
|
||||
}
|
||||
|
||||
void MwLLLine(MwLL handle, MwPoint* points, MwLLColor color) {
|
||||
HPEN pen = CreatePen(PS_SOLID, 1, RGB(color->red, color->green, color->blue));
|
||||
|
||||
SelectObject(handle->hDC, pen);
|
||||
MoveToEx(handle->hDC, points[0].x, points[0].y, NULL);
|
||||
LineTo(handle->hDC, points[1].x, points[1].y);
|
||||
|
||||
DeleteObject(pen);
|
||||
}
|
||||
|
||||
MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b) {
|
||||
MwLLColor c = malloc(sizeof(*c));
|
||||
HDC dc = GetDC(handle->hWnd);
|
||||
|
||||
@@ -123,6 +123,12 @@ void MwLLPolygon(MwLL handle, MwPoint* points, int points_count, MwLLColor color
|
||||
free(p);
|
||||
}
|
||||
|
||||
void MwLLLine(MwLL handle, MwPoint* points, MwLLColor color) {
|
||||
XSetForeground(handle->display, handle->gc, color->pixel);
|
||||
|
||||
XDrawLine(handle->display, handle->pixmap, handle->gc, points[0].x, points[0].y, points[1].x, points[1].y);
|
||||
}
|
||||
|
||||
MwLLColor MwLLAllocColor(MwLL handle, int r, int g, int b) {
|
||||
MwLLColor c = malloc(sizeof(*c));
|
||||
XColor xc;
|
||||
|
||||
Reference in New Issue
Block a user