GraphicsPath::Outline problem (GDI+)
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
I'm having a problem with the Outline method not working after I've applied a certain transformation to the GraphicsPath object (see code below). The problem occurs after the GraphicsPath object is scaled with either the X factor or/and the Y factor set to a negative value (causing flip/mirror). Code:
GraphicsPath path1; GraphicsPath path2; path1.AddString(L"GDI+", -1, &family, FontStyleRegular, 144, rect, &format); path2.AddString(L"GDI+", -1, &family, FontStyleRegular, 144, rect, &format); REAL offsetX = rect.GetLeft() + rect.Width / 2.0f; REAL offsetY = rect.GetTop() + rect.Height / 2.0f; Matrix matrix; matrix.Translate(-offsetX, -offsetY, MatrixOrderAppend); matrix.Scale(1.0f, -1.0f, MatrixOrderAppend); // negative Y factor causing // the path to "flip" matrix.Translate(offsetX, offsetY + 110.0f, MatrixOrderAppend); path2.Transform(&matrix); Pen pen(Color(255, 255, 0, 0)); path1.AddPath(&path2,TRUE); path1.Outline(); // fails due to the scaling transformation above // the shapes overlap instead om "melting together" pGraphics->DrawPath(&pen, &path1);
Any light on this problem would be much appreciated.:) (Using VC 6.0 and the C++ version of GDI+)