• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

RenderinginDelphiusingTCanvas(FMX)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
 

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/


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Delphi定义多维数组和读取多维数组发布时间:2022-07-18
下一篇:
Delphi重载,覆盖,多态发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap