VB 2008 GDI +如何在列表中旋转单个图像? [英] VB 2008 GDI+ How do you rotate individual images in a list?

查看:81
本文介绍了VB 2008 GDI +如何在列表中旋转单个图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个流星列表,我需要根据它们的旋转速度单独旋转。



I have a list of meteors that I need to rotate individually based on their rotation speed.

Private Sub Form1_Paint5(ByVal sender As Object, ByVal e As  _
        System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint

        For Each I As Meteor In Meteors ' Draw and Rotate Meteors
            'Rotate I by I.Rotspeed
            e.Graphics.DrawImage(I.Type, I.Pos)
        Next
End Sub





使用其他语言不是一种选择。



Using another language is not an option.

推荐答案

您可以使用 System.Drawing.Graphics.Transform

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform.aspx [ ^ ],

http://msdn.microsoft .com / zh-cn / library / system.drawing.drawing2d.matrix.aspx [ ^ ]。



想法是改变tr当你从一个绘制原语转到另一个绘制原语时来回回复。 (可选)您可以来回旋转变换矩阵的相同实例。谨防旋转中心:许多外出询问者抱怨他们的图像消失,但实际上他们只是在偏离中心的旋转中心周围旋转了一些东西,这些旋转中心将他们的图像移出剪辑区域。



-SA
You can use System.Drawing.Graphics.Transform:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.transform.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.matrix.aspx[^].

The idea is changing transform back and forth as you go from one draw primitive to be rendered to another. Optionally, you can rotate the same instance of transform Matrix back and forth. Beware of the rotation center: many out inquirers complained that their images "disappeared", but actually they simply rotated something around some off-center rotation center which moved their images out of the clip region.

—SA


这篇关于VB 2008 GDI +如何在列表中旋转单个图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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