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 XE5 Firemonkey Paint Demo 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 );
var
context: CGContextRef;
begin
// [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;
end;

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
DelphiDemoFiremonkeyIOSLinuxOSXWindows

Bring OpenAI Agents, Vision, Audio, And Realtime AI To Firemonkey

DelphiIDEWindows

Add AI Pair Programming, Refactoring, And Multi-LLM Workflows To RAD Studio

DelphiDemoFiremonkeyLibraryWindows

Bring OpenAI, Local LLMs, And AI Assistants To FMX Apps

DelphiFiremonkeyLibrary

DelphiGemini Brings Native Google Gemini AI Integration To Delphi

Sign up for our Newsletter and
stay informed
[mailpoet_form id="1"]

Leave a Reply