最佳的GDI绘制方法 [英] Best GDI drawing approach

查看:38
本文介绍了最佳的GDI绘制方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一生中的大部分时间都在开发交互式CD,我写了一些控制台应用程序,这些程序对我来说主要是图形化的.

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

这是我的方法:

我正在使用形状和图像在canava上进行绘图,图像的左侧和顶部位置存储在文件中.有没有更简单的方法?我以为使用形状对象会简化我的工作,你们觉得呢?

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 ?

欢迎任何示例.

如果您认为这个问题是主观的,请投票关闭.

If you consider this question subjective please vote for closing.

推荐答案

正确的方法是编写OnPaint处理程序(即,监听WM_PAINT消息)并使用GDI进行绘制.

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.

这篇关于最佳的GDI绘制方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆