' 实例来源:https://blog.csdn.net/kakaxi2222/article/details/50708552 x = 起点.x y = 起点.y dx = 取绝对值(终点.x - 起点.x) dy = 取绝对值(终点.y - 起点.y) 判断(终点.x > 起点.x) s1 = 1 s1 = -1
判断(终点.y > 起点.y) s2 = 1 s2 = -1
判断(dy > dx) temp = dx dx = dy dy = temp interchange = 1 interchange = 0 p = 2 × dy - dx 清除数组(坐标) 变量循环首(1, dx, 1, i) ' SetPixel (hdc, x, y, color) pt.x = x pt.y = y 加入成员(坐标, pt) 如果真(p ≥ 0) 判断(interchange = 0) y = y + s2 x = x + s1 p = p - 2 × dx 判断(interchange = 0) x = x + s1 y = y + s2 p = p + 2 × dy 变量循环尾()