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. 简洁常用权限系统的设计与实现(三):维护和利用节点的深度level,迭代实现树的构造

    如果在节点的属性中,增加一个level属性,即树的深度,构造树会非常容易.前提是,增加和修改节点的时候,要维护level. 根节点的level为1,下一级为2,以此类推. 构造树的方法,主要有2个: ...

  2. android --Activity生命周期具体解释

    一. 再探Activity生命周期 为了研究activity的生命周期,简单測试代码例如以下. package com.example.testactivity; import android.app ...

  3. HDU 1422 重温世界杯 - 贪心

    传送门 题目大意: 给一串数,又正有负,求每一个前缀都大于0的最长子串长度. 题目分析: 直接贪心:每次左端点向右推1,不断延伸右端点,更新答案. code #include<bits/stdc ...

  4. JQuery通过radio,select改变隐藏显示div

    版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/qq_36092584/article/details/52740681 1)select下拉框控制d ...

  5. JQuery 多个checkbox 只选中一个

    <form id="common-form"> <input name="check1" type="checkbox"/ ...

  6. 微信小程序的轮播图swiper问题

    微信小程序的轮播图swiper,调用后,怎样覆盖系统的 点,达到自己想要的效果 不多说,先上一图望大家多给意见: 这个是效果图: 微信小程序效果图就成这样子: <view class=" ...

  7. Apparatus, system, and method for automatically minimizing real-time task latency and maximizing non-real time task throughput

    An apparatus, system, and method are provided for automatically minimizing Real-Time (RT) task laten ...

  8. python列表分页

    列表分页   上章的结束,若在实际开发过程中,会发现一个问题,那就首页或关注分享,是一下子按时间顺序全部显示出来,这在实际项目中不可能出现的,想想实际中的产品是如何做的? 一般来说,无非是两种,一种是 ...

  9. CSS 中的高度百分比

    CSS 中可以使用%来给定指定元素的大小,也就是高度.宽度.margin,padding 等等,但是相信很多人都对百分比表示法的具体含义并不清楚,那么不懂就练,毕竟是检验真理的唯一标准(考研党举个手我 ...

  10. ThoughtWorks、Teambition、Trello、Slack、DevCloud 主流敏捷软件开发工具平台比较

    在大公司做了6年程序员,2年项目经理的小王,正在创业公司迎来他焦虑的而立之年. 但是对于3个月前加入创业公司的决定,他现在有些烦躁和怀疑人生.在他过往的经验看来,公司新接的小项目,在过去的大公司里1个 ...