Skip to content

New Graphics Enhancements in Xojo

Let’s talk about the new properties and methods added to the Graphics class that will make all your Paint drawings more flexible and powerful! The enhancements include: LineDash, LineCap, LineJoin, the new Brush property with LinearGradientBrush, RadialGradientBrush, ShadowBrush and PictureBrush, and the new PictureBrush class.

You aren’t restricted to using solid lines anymore as the outline in the drawing of lines, rectangles, circles, ovals or paths anymore. From now on you can set the LineDash property of your choice, you can even set the LineDashOffset property and the LineCap and LineJoin from the supported types.

Moreover, the drawing fill is no longer limited to a solid color! The Graphic class includes now the Brush property, so you can create any of the supported brushes and assign any of them to it. For example, you can create color gradients really easy creating new instances from the LinearGradientBrush, RadialGradientBrush and assigning these to the Brush property. Of course, you can set as many GradientStops on these with the desired color to create the transition from one color to other in your gradient at given points during the filling process.

And, even better, you’re not restricted to using solid colors or gradient colors when you fill an object. Use the new PictureBrush class to assign the Picture you want to use for the fill and even the fill mode: Pad, Tile or Mirror.

Further, you can now give your text or shapes a shadow using the ShadowBrush property in the Graphics class, and the ability to create new instances from the ShadowBrush class.

In fact, when you use the default constructor of the ShadowBrush class, you’ll get an object right to use with a default color, offset for the X and Y coordinates and by default blur amount. Of course you can set any of these properties as you need for your ShadowBrush instances!

Questions? Ask me on Twitter @XojoES or on the Xojo Forum.