zoukankan      html  css  js  c++  java
  • Rendering in Delphi using TCanvas (FMX)

     

    DrawingCanvas

    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/

  • 相关阅读:
    Netty源码剖析-关闭服务
    Netty源码剖析-断开连接
    Netty源码剖析-发送数据
    Netty源码剖析-业务处理
    Netty源码剖析-接受数据
    Netty源码剖析-构建链接
    html中调用silverlight中的方法
    在Silverlight宿主html页面添加按钮无法显示
    win7旗舰版在安装vs2010后向sql2008添加SQL_Server_Management详解
    javascript arguments
  • 原文地址:https://www.cnblogs.com/findumars/p/6680063.html
Copyright © 2011-2022 走看看