在C#中使用GDI进行游戏飞机射击 [英] use GDI to game plane fire in C#

查看:65
本文介绍了在C#中使用GDI进行游戏飞机射击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C#中使用GDI,在图片框上绘图,如下所示。现在我想在picturebox坐标中分配不同的图像然后怎么帮我。



链接图片

I use GDI in C #, drawing on picture box as shown below. now I want to assign different image in picturebox coordinates then how.help me.

link image

推荐答案

PictureBox 控件在这里没用。即使你能做到这一点,也没有任何实际意义,因为这种控制根本无法帮助你。我会告诉你你能做些什么。



请看我过去的答案:

在图片框中附上图片 [ ^ ],

用C#绘制一个矩形 [ ^ ],

如何从旧图纸中清除面板 [ ^ ],

mdi子表单之间的绘制线 [ ^ ],

在面板上捕获绘图 [ ^ ],

什么样的俏皮方法是Paint? (DataGridViewImageCell.Paint(...)) [ ^ ],

如何加速我的vb.net应用程序? [ ^ ]。



-SA
The PictureBox controls is useless here. Even though you can do it, it would not make any practical sense, as this control won't help you at all. I'll tell you what can you do instead.

Please see my past answers:
Append a picture within picturebox[^],
draw a rectangle in C#[^],
How do I clear a panel from old drawing[^],
Drawing Lines between mdi child forms[^],
capture the drawing on a panel[^],
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
How to speed up my vb.net application?[^].

—SA


你可以用以下两种方法之一:



1.创建一个具有图片框大小的Bitmap对象,使用Graphics.CreateFromImage()函数来允许你要在位图上绘图(使用DrawImage()函数),然后将你的Bitmap对象指定为PictureBox的Image属性



2.或者,在PictureBox.Paint中()事件,使用e.Graphics.DrawImage()来绘制你的bitma p在任何时候
You can do this one of two ways:

1. Create a Bitmap object that has the size of your picture box, use the Graphics.CreateFromImage() function to allow you to draw on the bitmap (using the DrawImage() function), then assign your Bitmap object as the PictureBox's Image property

2. Alternatively, in the PictureBox.Paint() event, use e.Graphics.DrawImage() to draw your bitmap at any point


这篇关于在C#中使用GDI进行游戏飞机射击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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