PDFsharp & MigraDoc Foundation
http://forum.pdfsharp.com/

Fill shape with pattern (vs. solid color)
http://forum.pdfsharp.com/viewtopic.php?f=2&t=2869
Page 1 of 1

Author:  ariscol [ Thu Jul 24, 2014 7:03 am ]
Post subject:  Fill shape with pattern (vs. solid color)

I have a scenario where I have to render a polygon to the pdf, and it needs to be filled with a meaningful color, i.e. if it's Red, that means one thing, if it's yellow that means something else. This is done with a dynamic collection of points, depending on the input to the program. So, for example:

Code:
gfx.DrawPolygon(pen, XBrushes.Yellow, points, XFillMode.Winding);


"points", of course, being an array of XPoint[]. As written above, this makes a beautiful yellow polygon as expected. So then my real problem is that sometimes I want yellow polygons, sometimes red, and sometimes I want to make a polygon red AND yellow (I was imagining a pattern of yellow and red stripes or something to make it obvious that the polygon is both red AND yellow. Anybody have any good ideas of how to either:

a) fill a polygon with a series of stripes of 2 different colors,
OR
b) some other technique to make it clear that a colored background is actually a combination of two other meaningful colors.

PS. I considered something like Red & Yellow make Orange, but figured that wouldn't be clear enough (I have a feeling that many people would be fuzzy on color combination).

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/