Hi,
I am currently evaluating your software and the first impression is very good.
In my application I need to fill a triangle with a color where the color is depending on the x and y value within the triangle.
Here is my code where the triangle is filled with one color. It works fine.
Dim points(2) As Point
points(0) = New Point(200, 200) : points(1) = New Point(400, 300) : points(2) = New Point(300, 100)
Dim path As New PdfPath()
path.AddLine(points(0), points(1)) : path.AddLine(points(1), points(2)) : path.AddLine(points(2), points(0))
Dim pen As New PdfPen(Color.DeepSkyBlue, 0.02F)
Dim brush1 As PdfBrush = New PdfSolidBrush(Color.CadetBlue)
path.FillMode = PdfFillMode.Alternate
page.Canvas.DrawPath(pen, brush1, path)
I already studied LineairGradient and RadialGradient Brush but that does not bring the solution.
To give you an example, I already did some math:
For the above mentioned triangle, a reference to an RGB-color can be made with the following formula:
Z = 0.008125 * X - 0.00625 * Y + 0.625
E.g. Z = 1 then PdfSolidBrush(Color.FromArgb((CInt((CByte(255)))), (CInt((CByte(192)))), (CInt((CByte(128)))))), etc..
I can make that translation table myself.
So the question is:
Is it possible to fill a rectangle based on the x and y position in that rectangle.
Should I work with e.g. "dots"?
Please advise.
Kind regards
Andre