2014-09-15 5 views
0

텍스트와 연관된 화살표가 있습니다. 텍스트가 특정 지점에서 화살표와 겹칩니다. 나는 텍스트로 묶여있다 사각형에서 볼 수없는 화살표가 내가텍스트 상자가있는 겹침 선

AdjustableArrowCap *cap1 = new AdjustableArrowCap(5, 5, true); 
    Pen *myPen1 = new Pen(Color::Color(0,255,255), width); 

    myPen->SetCustomEndCap(cap1); 
    GraphicsPath path; 
    path.AddLine(point1,point2); 
    Font font(&FontFamily(L"arial"), 21); 
    Brush *brush=new SolidBrush(Color::Color(0,255,255,255)); 

    SolidBrush solidBrush(Color(255, 255, 0, 0)); 

    StringFormat format; 
    format.SetAlignment(StringAlignmentCenter); 
    format.SetLineAlignment(StringAlignmentCenter); 
    RectF rectbo; 
    graph->MeasureString(strdata,wcslen(strdata),&font,PointF::PointF(point2),&rectbo); 


    graph->DrawLine(myPen,point2,point1); 
    Region pathRegion(&path); 
    sta=pathRegion.Intersect(rectbo); 
    graph->fillRegion(pathRegion,&brush); 
    graph->DrawString(strdata,wcslen(strdata),&font,point2,&format,brush1); 
    } 

나는 내가 할 수 있도록하는 방법을 수없는 색상으로 선을 채우기 위해 노력 메신저 같은 느낌 다음과 같은 코드를 작성합니다 라인 보이지 않는.

답변

0

Point2에서 선을 그리는 대신 디자인 환경 설정에 따라 어떤 모서리 점 또는 가운데 모서리 점을 Point1에 가장 가까운쪽으로 계산 한 다음 선을 그립니다.