[Lazarus] Cross Codebot surface drawing examples
Fabio Luis Girardi
fluisgirardi at gmail.com
Thu Mar 26 20:59:31 CET 2015
2015-03-26 16:27 GMT-03:00 Anthony Walter <sysrpl at gmail.com>:
> Leonardo,
>
> You can absolutely use Cross Codebot to make controls, in any shape you
> want. These types of controls should be graphic controls, and I provide a
> bass class name TRenderGraphicControl in the Codebot.Controls unit to help
> in this endeavor.
>
> The key to making a control any shape with TRenderGraphicControl is to
> override the "protected procedure Render" method, and draw using the
> "protected property Surface: ISurface". Just doing your drawing in a non
> rectangular manner, for example:
>
> procedure TYourControl.Renderl
> begin
> Surface.Ellipse(ClientRect);
> Surface.Fill(NewBrush(clRed));
> end;
>
> And you control now appears as a nice anti-aliased red ellipse bound
> within the client area of your control. Obviously this is a trivial drawing
> example, but if you go to the Codebot Cross forums you can find examples of
> more complicated drawing. I regularly add new stock drawing functions to
> the Codebot.Graphics unit, along with control theming, so if you're
> interested you can reuse my some of stock routines to draw your custom
> controls, or reuse the theme drawing routines.
>
> I hope this helps.
>
>
>
Awesome!
--
The best regards,
Fabio Luis Girardi
PascalSCADA Project
http://sourceforge.net/projects/pascalscada
http://www.pascalscada.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150326/bccc8d98/attachment-0003.html>
More information about the Lazarus
mailing list