Drawing a polygon - RadaeePDF.com
Signin/Signup with: 
Welcome, Guest
Username: Password: Remember me
13 Jul 2017
Microsoft has ended support for Windows Phone 8.1
Read More...
Questions about Android development and PDF
  • Page:
  • 1

TOPIC: Drawing a polygon

Drawing a polygon 1 year 2 months ago #12848

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
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

Please Log in or Create an account to join the conversation.

Drawing a polygon 1 year 2 months ago #12851

  • nermeen
  • nermeen's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 865
  • Karma: 23
  • Thank you received: 70
You are setting a 200 as stroke width (very big):
using the following code you obtain the correct shap:
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:
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);

Attachments:

Please Log in or Create an account to join the conversation.

Drawing a polygon 1 year 2 months ago #12853

  • doubleeye
  • doubleeye's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Posts: 21
  • Thank you received: 0
Brilliant, thanks, I will give this a try!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Powered by Kunena Forum