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/

最新文章

  1. javascript数组的方法总结,非常实用的!
  2. NVIC优先级分组
  3. AC日记——神奇的幻方 洛谷 P2615(大模拟)
  4. linux读写ntfs
  5. Git学习记录
  6. srm 533
  7. 双向bfs-八数码问题
  8. dedecms织梦首页如何调用文章列表?
  9. linux快速清空文件 比如log日志
  10. shell的嵌入命令大全
  11. 秋招提前批小结(CVTE一面挂、阿里三面挂)
  12. mingw 构建 gdal 2.1.2
  13. 存储过程 Mvc 的调用
  14. centos 6.5 安装mplayer
  15. 8、Android---探究服务
  16. JSTL详解(一)
  17. 使用JS 加入收藏,设为首页.
  18. CentOS源码安装QT
  19. 【转】Monkey测试4——Monkey命令行可用的全部选项
  20. RequestMapping请求映射方式

热门文章

  1. WPF 使用鼠标拖动一个控件的实现[2018.7.15]
  2. 英文构词法 —— circum- 前缀
  3. Internet protocol optimizer
  4. Arcgis api for javascript学习笔记(4.5版本) - 本地部署及代理配置
  5. BS_OWNERDRAW风格的作用和例子(值得研究,待续)
  6. sql获取数据库的所有表以及名称字段
  7. HSQL一个简短的引论
  8. Android 4.0新增Space及GridLayout初谈
  9. twemproxy架构分析——剖析twemproxy代码前编
  10. 冒泡排序 和 选择排序的 区别 python