Rendering in Delphi using TCanvas (FMX)
BY CRAIG CHAPMAN · PUBLISHED 2015-08-05 · UPDATED 2015-08-20

I have a customer with an application which makes heavy use of GDI calls for graphics rendering, and with a desire to migrate this application to OSX. Unfortunately, in this case, OSX has no GDI to call upon, and so the low level drawing functions must be replaced.
In the video, I demonstrate how to use FMX to perform simple drawing operations, similar to those that would have been done with the VCL TCanvas or GDI. As per request, these routines are placed into a separate unit as procedural code, though you could translate it to a more object-oriented approach if you’d prefer that.
[* Note *] This form of rendering is not the fastest performing. It will compare approximately to GDI rendering, however, it would not be sufficient for high-speed graphics as might be required for games applications. For those purposes, please see my posts on building a sprite engine.
Here we go…
And the source code can be downloaded here
Note!: In this video, and attached source code, I perform drawing operations outside of the OnPaint() event handler. This works on Windows because the DirectX context is persistent, however, under all other platforms rendering is done using OpenGL which encapsulates rendering operations between Begin…End calls. These calls prepare the OpenGL state machine for updates, and so you can’t render outside of them. Despite this error on my part, I believe this demonstration still illustrates the point I was trying to make with it.
http://chapmanworld.com/2015/08/05/rendering-in-delphi-using-tcanvas-fmx/
Rendering in Delphi using TCanvas (FMX)的更多相关文章
- 关于Delphi XE2的FMX的一点点研究之消息篇
Delphi XE2出来了一阵子了,里面比较抢眼的东西,除了VCLStyle这个换肤的东西之外,另外最让人眼亮的应该是FMX这个东西了.万一的博客上都连载了一票的关于FMX的使用心得了.我还是没咋去关 ...
- DELPHI (VCL及FMX[Firemonkey])启动时的欢迎窗口实现代码
VCL里面的的实现 program ZhouFamily; uses Vcl.Forms, Winapi.Windows, FrmZhouFamilyMainU in 'FrmZhouFamilyMa ...
- QT类库与Delphi类库的体系结构对比——两者十分类似!
今天在看QT对象内存管理的一篇文章时:http://blog.csdn.net/dbzhang800/article/details/6300025想到了一个问题:就是QT类库体系结构与Delphi类 ...
- Delphi 10.2.3 + Xcode 9.2 开发 IOS 程序,免证书+免越狱,真机调试
工具列表: 1,delphi 10.2.3 + PAServer19.0. 2,配置好一些的 PC 一台,建议至少 4 代 intel i5 + 16G + 256GSSD,低于此配置将产生拖延症. ...
- 玄虚出品Delphi教程的前言 good
VCL是基于系统的,根本在于系统API,FMX是基于绘图的,根本在于渲染引擎 VCL的发展受制于系统,(你在VCL的代码里面可以看到Borland对M$的妥协),而FMX的发展仅仅受制于硬件 VCL ...
- QT类库与Delphi VCL类库的体系结构对比——两者十分类似!
今天在看QT对象内存管理的一篇文章时:http://blog.csdn.net/dbzhang800/article/details/6300025想到了一个问题:就是QT类库体系结构与Delphi类 ...
- ListView 下拉更新 (支持 Android)
注意:XE7 已提供下拉更的功能. 说明:展示如何在 Android 平台下,使用 ListView 下拉更新. 适用:Delphi XE5 , XE6 修改:需要修改到 Delphi 源码 FMX. ...
- [转]乐死我了,怎么样成为一个全栈程序员(Full Stack Developer),附我想专注的语言
受苏格拉底大神的启迪,我也来谈谈全栈.禅师:成为全栈工程师,这个问题等于如何成为全才,有可能吗码农:有可能,不过可能性比较低,因为达芬奇这类人毕竟是百年一遇的奇才.不过,因为我热爱这个行业,也有一定天 ...
- Android实例-使用自定义字体文件(XE8+小米2)
结果: 1.需要修改DELPHI自身的FMX.FontGlyphs.Android.pas,复制到程序的根目录下(红色部分为修改过的). 2.字体文件从 C:\Windows\Fonts 直接拷贝到A ...
随机推荐
- LUOGU 1137 - 拓扑排序
传送门 题目分析 拓扑排序:将图从度为0的点不断的剥掉外层的点,即可得到拓扑序,再按照拓扑序进行一遍简单的dp. code #include<bits/stdc++.h> using na ...
- WPF入门(三)->几何图形之不规则图形(PathGeometry) (2)
原文:WPF入门(三)->几何图形之不规则图形(PathGeometry) (2) 上一节我们介绍了PathGeometry中LineSegment是点与点之间绘制的一条直线,那么我们这一节来看 ...
- Lua转让C功能
在上一篇文章中(C调用lua函数)中.讲述了怎样用c语言调用lua函数,通常,A语言能调用B语言,反过来也是成立的.正如Java 与c语言之间使用JNI来互调.Lua与C也能够互调. 当lua调用c函 ...
- Android studio 无法启动安卓模拟器
1.通过Android SDK Manager在extra中,找到并选中了那个Intel x86 Emulator Accelerator (HAXM) 2.手动启动HAXM 去对应的sdk\e ...
- windows下Eclipse启动tomcat提示port已被占用 already in use
>netstat -ano | findstr 8009 TCP 127.0.0.1:8005 0.0.0.0:0 LISTENING ...
- Hibernate综合问题
n + 1问题 query.iterate()信息返回迭代查询将开始发表声明:录ID语句 Hibernate: select student0_.id ascol_0_0_from t_student ...
- Android Studio:Grade 全局参数定义
Grade 全局参数定义 实际开发中设置公共的编译依赖参数等. 方法一: 在项目外层的build.gradle文件中定义,格式如下: 文件名:build.gradle ext { sourceComp ...
- 简明Python3教程 17.更多
简介 迄今为止我们已经学习了python中的大多数常用知识.本章中我们会接触到更多的知识,使得我们更全面的掌握python. 传递元组 你是否希望过从函数返回两个不同的值?做到这点使用元组即可. &g ...
- 使用Qt installer framework制作安装包(不知道是否适合Mac和Linux?)
一.介绍 使用Qt库开发的应用程序,一般有两种发布方式:(1)静态编译发布.这种方式使得程序在编译的时候会将Qt核心库全部编译到一个可执行文件中.其优势是简单单一,所有的依赖库都集中在一起,其缺点也很 ...
- js仿黑客帝国文字数字雨效果
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...