All it did was reset to the default colour of black. I thought perhaps there was a bug in there somewhere, and that something was being affected by the previous setting of the Fill colour, so I deployed the ResetCMYKColorFill() method in the hope that it did something. I thought maybe this method was working on percentages as I would expect with CMYK, so I originally supplied the value 0, 100, 100, 0 to represent Warm Red. The SetCMYKColorFill() method used just above accepts ints, rather than floats. Strange, but workable if you stick to the usual CMYK percentages, and don't accidentally type in an extra zero. The values are treated as being relative to eachother, so for 100% blue (Cyan) i could just have validly provided 3000f, 0f, 0f, 0f. In fact, I can provide any value I want, so long as it is a valid float. Providing values that represent the percentages works fine. The constructor for CMYKColor() requires four floats. Neither was intuitive, given that generally, CMYK colours are represented as a series of percentages. Rather irritatingly, I found you have to guess at the actual values required by the two methods concerning the use of CMYK colour I have used so far. To add a circle to the square so that it fits nicely, the following code will do: Looking at the first of the 4 squares above, it is relatively easy to determine that the width and height is 100 points, and that the center point is at 120 x, 250 y. Other preset shapes include the Circle, but the x and y coordinates that are passed in represent the center point of the shape, followed by a value representing the radius. The final two parameters are the width and height. When using a Rectangle object to represent a square or rectangle instead of drawing it, the first two parameters represent the x and y coordinates of the bottom right hand corner. Cb.SetColorStroke( new CMYKColor(1f, 0f, 0f, 0f)) Ĭb.SetColorFill( new CMYKColor(0f, 0f, 1f, 0f))
0 Comments
Leave a Reply. |