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…

Video Player

 
 

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)的更多相关文章

  1. 关于Delphi XE2的FMX的一点点研究之消息篇

    Delphi XE2出来了一阵子了,里面比较抢眼的东西,除了VCLStyle这个换肤的东西之外,另外最让人眼亮的应该是FMX这个东西了.万一的博客上都连载了一票的关于FMX的使用心得了.我还是没咋去关 ...

  2. DELPHI (VCL及FMX[Firemonkey])启动时的欢迎窗口实现代码

    VCL里面的的实现 program ZhouFamily; uses Vcl.Forms, Winapi.Windows, FrmZhouFamilyMainU in 'FrmZhouFamilyMa ...

  3. QT类库与Delphi类库的体系结构对比——两者十分类似!

    今天在看QT对象内存管理的一篇文章时:http://blog.csdn.net/dbzhang800/article/details/6300025想到了一个问题:就是QT类库体系结构与Delphi类 ...

  4. Delphi 10.2.3 + Xcode 9.2 开发 IOS 程序,免证书+免越狱,真机调试

    工具列表: 1,delphi 10.2.3 + PAServer19.0. 2,配置好一些的 PC 一台,建议至少 4 代 intel i5 + 16G + 256GSSD,低于此配置将产生拖延症. ...

  5. 玄虚出品Delphi教程的前言 good

    VCL是基于系统的,根本在于系统API,FMX是基于绘图的,根本在于渲染引擎  VCL的发展受制于系统,(你在VCL的代码里面可以看到Borland对M$的妥协),而FMX的发展仅仅受制于硬件 VCL ...

  6. QT类库与Delphi VCL类库的体系结构对比——两者十分类似!

    今天在看QT对象内存管理的一篇文章时:http://blog.csdn.net/dbzhang800/article/details/6300025想到了一个问题:就是QT类库体系结构与Delphi类 ...

  7. ListView 下拉更新 (支持 Android)

    注意:XE7 已提供下拉更的功能. 说明:展示如何在 Android 平台下,使用 ListView 下拉更新. 适用:Delphi XE5 , XE6 修改:需要修改到 Delphi 源码 FMX. ...

  8. [转]乐死我了,怎么样成为一个全栈程序员(Full Stack Developer),附我想专注的语言

    受苏格拉底大神的启迪,我也来谈谈全栈.禅师:成为全栈工程师,这个问题等于如何成为全才,有可能吗码农:有可能,不过可能性比较低,因为达芬奇这类人毕竟是百年一遇的奇才.不过,因为我热爱这个行业,也有一定天 ...

  9. Android实例-使用自定义字体文件(XE8+小米2)

    结果: 1.需要修改DELPHI自身的FMX.FontGlyphs.Android.pas,复制到程序的根目录下(红色部分为修改过的). 2.字体文件从 C:\Windows\Fonts 直接拷贝到A ...

随机推荐

  1. 2015-07-30Java 错题

    2 推断对错.在java的多态调用中,new的是哪一个类就是调用的哪个类的方法. 正确答案: A 对 错 解析: java多态有两种情况:重载和覆写 在覆写中.运用的是动态单分配.是依据new的类型确 ...

  2. 第三方微信支付,WAP、H5、APP、公众号支付的区别

    你说一个微信支付被腾讯搞了N个版本出来,是技术问题还收费原因不得而知.公众号支付,H5(wap)支付,APP支付.看得小编一头雾水. 带点N个疑问? 1.公众号支付是在公众号里支付,支众号里引入的三方 ...

  3. 微信小程序实例:实现tabs选项卡效果

    最近微信应用号是炒的如火如荼,热门满满,但是也可以发现搜索关键词出来,各类网站出现的还都是微信的官方文档解释.正好赶上这个热潮,这几天先把小程序技术文档看了个遍,就直接着手写案例了.很多组件微信内部已 ...

  4. 使用dom4j来处理xml的一些常用方法

    要使用dom4j读写XML文档,需要先下载dom4j包,dom4j官方网站在 http://www.dom4j.org/ 解开后有两个包,仅操作XML文档的话把dom4j-1.6.1.jar加入工程就 ...

  5. windows 10 使用 tricks

    全新的环境变量编辑界面, 全新的[任务管理器]⇒ [性能] 0. 添加开机启动项 将要添加的开机自启动软件的快捷方式添加到如下的路径: C:\Users\hasee\AppData\Roaming\M ...

  6. Massive Collection Of Design Patterns, Frameworks, Components, And Language Features For Delphi

    Developer beNative over on GitHub has a project called Concepts which is a massive collection of Del ...

  7. kill the lock

    $ killall -s 9 krunner_lock [ZT][From:] http://www.commandlinefu.com/commands/view/2264/unlock-your- ...

  8. WinForm导出文件

    1 using System;  2 using System.Collections.Generic;  3 using System.Linq;  4 using System.Text;  5 ...

  9. 微信小程序之购物车

    这里演示从商品列表中添加到购物车 下面先做商品列表页.如下图: 布局分析: 首先一个list的主盒子,接着是item盒子,这是必须的.然后把item分成左侧的图片部分,和右侧的说明部分(item盒子使 ...

  10. matlab 求解 Ax=B 时所用算法

    x = A\B; x = mldivide(A, B); matlab 在这里的求解与严格的数学意义是不同的, 如果 A 接近奇异,matlab 仍会给出合理的结果,但也会提示警告信息: 如果 A 为 ...