Best GDI drawing approach

喜你入骨 提交于 2019-12-08 11:52:35

问题


I am developing an interactive CD most of my life I wrote console applications writing something mostly graphical is akward for me.

So here is my approach :

I am drawing on the canavas using shapes and images the left and top position are stored in a file. Is there any easier approach ? I thought using shapes objects would simplify my work what do you guys think ?

Any examples are welcome.

If you consider this question subjective please vote for closing.


回答1:


The proper way is to write an OnPaint handler (that is, listening to the WM_PAINT message) and drawing using the GDI.

Here are a couple of simple examples:

  • Moving triangles
  • Bouncing ball

Drawing by moving controls is very awkward.




回答2:


Since you didn't specify a any version, I assume you're not wasting your time with an ancient Delphi, so maybe you should also take a look at FireMonkey.

That also opens the door to having your interactive stuff work on other platforms..




回答3:


I recommend the Delphi GDI+ Library which I have used with success. It's a wrapper around GDI+ which takes alot of the pain out of it.



来源:https://stackoverflow.com/questions/16948576/best-gdi-drawing-approach

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!