- Posts: 21
- Thank you received: 0
Microsoft Windows Phone 8.1 support ends (13 Jul 2017)
Microsoft has ended support for Windows Phone 8.1
Questions about Android development and PDF
Drawing a polygon
IP: 192.168.0.71
8 years 6 months ago #12848
by doubleeye
Drawing a polygon was created by doubleeye
Good day, please advise me how to draw a polygon using the latest library version.
This is what I currently have
Page page = m_doc.GetPage(vpage.GetPageNo());
page.ObjsStart();
Path path = new Path();
path.MoveTo(100, 100);
path.LineTo(120, 100);
path.LineTo(120, 130);
path.LineTo(110, 120);
path.LineTo(100, 130);
path.LineTo(100, 100);
path.ClosePath();
int color = 0x99ff0000;
page.AddAnnotPolygon(path, color, color, 200);
page.Close();
path.Destroy();
it should look like a bookmark icon but it looks very strange with lines going all over the place
This is what I currently have
Page page = m_doc.GetPage(vpage.GetPageNo());
page.ObjsStart();
Path path = new Path();
path.MoveTo(100, 100);
path.LineTo(120, 100);
path.LineTo(120, 130);
path.LineTo(110, 120);
path.LineTo(100, 130);
path.LineTo(100, 100);
path.ClosePath();
int color = 0x99ff0000;
page.AddAnnotPolygon(path, color, color, 200);
page.Close();
path.Destroy();
it should look like a bookmark icon but it looks very strange with lines going all over the place
IP: 192.168.0.71
8 years 6 months ago #12851
by nermeen
Replied by nermeen on topic Drawing a polygon
You are setting a 200 as stroke width (very big):
using the following code you obtain the correct shap:
If you want it upside down:
using the following code you obtain the correct shap:
Code:
Path path = new Path();
path.MoveTo(100, 100);
path.LineTo(120, 100);
path.LineTo(120, 130);
path.LineTo(110, 120);
path.LineTo(100, 130);
path.LineTo(100, 100);
path.ClosePath();
int color = 0x99ff0000;
page.AddAnnotPolygon(path, 0xff000000, color, 2);
If you want it upside down:
Code:
Path path = new Path();
path.MoveTo(100, 130);
path.LineTo(120, 130);
path.LineTo(120, 100);
path.LineTo(110, 110);
path.LineTo(100, 100);
path.LineTo(100, 130);
path.ClosePath();
int color = 0x99ff0000;
page.AddAnnotPolygon(path, 0xff000000, color, 2);
IP: 192.168.0.71
8 years 6 months ago #12853
by doubleeye
Replied by doubleeye on topic Drawing a polygon
Brilliant, thanks, I will give this a try!
Time to create page: 0.418 seconds