Get access to over 100 FireMonkey cross platform samples for Android, IOS, OSX, Windows, and Linux!

AppmethodCode SnippetComponentDelphiFiremonkeyIOS

Native Paint API Demo App With Delphi XE5 Firemonkey For IOS

| Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOS

Delphi XE5 Firemonkey Paint Demo IOS | Delphi 11 10 XE8 XE7 XE Seattle Berlin Tokyo Rio Firemonkey Delphi Android Delphi IOSIf you’re looking to use native components on IOS to build your apps one solution is the DPF IOS suite. The components in the suite actually wrap the native IOS controls just like the Delphi VCL wraps the native Windows controls. One benefit to using the native controls is that they are really fast and one drawback is that you can’t mix visual Delphi XE5 Firemonkey controls and DPF controls on the same form. In any event the DPF IOS controls come with a demo called Painter and it demonstrates how to use the DPF IOS controls to create an app like Painter that does native drawing. Painter only has one draw function which is to draw rectangles and it has a slider at the bottom which controls line with. However, you should be able to add other drawing types pretty easily once you take a look at the draw rectangle source code. DPF IOS is a pretty mature framework and has been in development since May of 2013. Here is the sample draw rect function from the demo:
procedure TFDrawingNative.DPFUIView1DrawRect( Sender: TObject; Rect: DPFNSRect );
context: CGContextRef;
// [self.backgroundColor set];
// UIRectFill(rect);

context := UIGraphicsGetCurrentContext( );

CGContextAddPath( context, path );
CGContextSetLineCap( context, kCGLineCapRound );
CGContextSetLineWidth( context, self.lineWidth );
CGContextSetStrokeColorWithColor( context, self.lineColor.CGColor );

CGContextStrokePath( context );

isEmpty := False;

Head over and download the DPF IOS suite for Delphi XE5 and check out the Painter demo.

Have Delphi Firemonkey questions? Ask and get answers on StackOverflow.

Related posts

AutoBlogAI: FireMonkey Client To Leverage LLMs And Generative AI For Blogging


Unleashing Creativity With Song Writer AI: A Deep Dive


How To Build Stable Diffusion Text To Image Prompts


FireMonkey 10.4.2 Features Updated iOS 14, Android 11, And macOS 11 Support Plus Hundreds Of Fixes

Sign up for our Newsletter and
stay informed

Leave a Reply