0

基本上我有一个程序可以移动用 MFC 中的钢笔工具绘制的线条。我使用滑块来操作钢笔工具。我只是想知道是否可以使用 .bmp 替换钢笔工具?这是一些示例代码:

 if (thePart->GetType() == PART_LINKAGE)
            {
               // draw control link pin in black
               dc.SelectObject(&Pen[3]);
               theNewPos = thePart->Getpoint();
                  dc.MoveTo( cx + (int32_t)(fScale * (theNewPos.GetX()+fx)) - 5,   
                                cy - (int32_t)(fScale * (theNewPos.GetY()+fy)) ); 
                  dc.LineTo( cx + (int32_t)(fScale * (theNewPos.GetX()+fx)) + 4,   
                                cy - (int32_t)(fScale * (theNewPos.GetY()+fy)) ); // 
                  dc.MoveTo( cx + (int32_t)(fScale * (theNewPos.GetX()+fx)),   
                                cy - (int32_t)(fScale * (theNewPos.GetY()+fy)) - 5); 
                  dc.LineTo( cx + (int32_t)(fScale * (theNewPos.GetX()+fx)),   
                                      cy - (int32_t)(fScale * (theNewPos.GetY()+fy)) + 4); 
               dc.SelectObject(&Pen[iID])

;

4

1 回答 1

1

当然,至少有点。抬头看LineDDA。它会给你线上每个像素的点;您可以根据这些点将位图插入正确的位置。

于 2011-10-24T13:32:57.317 回答