我有一条类似于箭头的线。我在该行的顶部绘制一个文本。现在我想要删除与文本重叠的部分行
我目前的代码是:
SolidBrush *brush1=new SolidBrush(Color::Color(0,167,255));
StringFormat format;
format.SetAlignment(StringAlignmentCenter);
format.SetLineAlignment(StringAlignmentCenter);
graph->DrawLine(myPen,point2,point1);
graph->DrawString(strdata,wcslen(strdata),&font,point2,&format,brush1);
我也试过
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 :(得分:1)
先画线然后画文字
我找到了你
LOGBRUSH::lbStyle=BS_NULL;
LOGBRUSH::lbStyle=BS_SOLID;
代表bsSolid等价物