0
基本的には、ペンツールで描かれた線をMFCに移動するプログラムがあります。私はスライダーを使ってペンツールを操作します。私はペンツールを.bmpを使って置き換えることが可能であるかどうか疑問に思っていましたか?次に、コードの例を示します。MFC C++のペン機能を.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])
;