10-20-壓路機路線(二)畫圖
阿新 • • 發佈:2018-11-08
1. paint函式,void CDemo_ShowRouteDlg::paint(CPoint point, double i_Scale, int i_num)。呼叫:paint(Point_Bitmap, i_scale, 2);
2.CPoint類。見百度百科。
3.CPaintDC。當前視窗作圖。https://blog.csdn.net/liuy_yy/article/details/7192567
4.CRect。矩形類,見百度百科
5.GetClientRect(&rect); 該函式獲取視窗客戶區的大小。
6.第一個點在左側中間,第二個點在右側中間,第三個點在上部中間,第四個點在下部中間
CPoint oPt1; oPt1.x=30 - 3; oPt1.y=20 + ylong / 2; CPoint xPt1; xPt1.x=30 + xlong + 3; xPt1.y=20 + ylong / 2; CPoint yPt1; yPt1.x=30 + xlong / 2; yPt1.y=20 - 3; CPoint yPt2; yPt2.x=30 + xlong / 2; yPt2.y=20 + ylong + 3;
7.Pen pen(Color(50,80,40,40), 20.0f);(分別是顏色,寬度)其中color的四個引數如下:
static ARGB MakeARGB(IN BYTE a, IN BYTE r, IN BYTE g, IN BYTE b) { return (((ARGB) (b) << BlueShift) | ((ARGB) (g) << GreenShift) | ((ARGB) (r) << RedShift) | ((ARGB) (a) << AlphaShift)); }
8.SolidBrush b_Brush(Color(50, 80, 20, 30));建立固體刷
9.GraphicsPath 繪圖路徑https://docs.microsoft.com/zh-cn/dotnet/api/system.drawing.drawing2d.graphicspath.-ctor?redirectedfrom=MSDN&view=netframework-4.7.2#System_Drawing_Drawing2D_GraphicsPath__ctor
10.PointF CenterPoint; //三角形中心點。浮點型的點
class PointF { public: PointF() { X = Y = 0.0f; }
}
11.Bitmap點陣圖資料。
12.Graphics https://blog.csdn.net/hireboy/article/details/8989997
13.Direction(m_PrePoint, CenterPoint, pp); 原函式:PointF* CDemo_ShowRouteDlg::Direction(PointF p0, PointF p1, PointF* point)
14.memDC.FillPolygon(&b_Brush, pp, 4); 填充多邊形
15.DrawImage
16.Invalidate( ) :使整個視窗客戶區無效, 並進行更新顯示的函式