iam是否创建a,b,c,d等的位图 [英] Whether iam creating a bitmaps of a,b,c,d etc

查看:83
本文介绍了iam是否创建a,b,c,d等的位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)Iam创建位图数组,然后如何合并所有这些位图单个位图.

2)基于为空间选择的值,我应该在位图之间保留空间,合并位图并显示
abc
a b c-字符之间的1个空格


1) Iam creating array of bitmaps then how can i merge all this bitmap single bitmap.

2) Based on value selected for space i should leave the space between the bitmaps and merge the bitmap and show
abc
a b c - 1 space between characters


in this way how shall i do this?

推荐答案

您可以使用System.Drawing完成所有操作.您只需要System.Drawing.GraphicsSystem.Drawing.Bitmap类:
http://msdn.microsoft.com/en-us/library/system.drawing. bitmap.aspx [ ^ ],
http://msdn.microsoft.com/en-us/library/system.drawing. graphics.aspx [^ ].

这个想法是这样的:创建一个具有所需大小和像素格式的目标位图,并获取System.Drawing.Graphics的实例,然后他们可以在该位图上绘制所需的任何内容;在您的问题中,您将需要在目标位图的图形上绘制源位图.

要创建新位图的实例,请参见其构造函数.

要获取此位图的System.Drawing.Graphics实例,请使用静态(工厂)方法System.Drawing.Graphics.FromImage:
http://msdn.microsoft.com/en-us/library/system. drawing.graphics.fromimage.aspx [ ^ ].

要在此位图的图形上绘制另一个位图,请使用System.Drawing.Graphics.DrawImage方法之一.

现在,您拥有要使用的所有类和方法以及对MSDN帮助页面的所有引用,这足以解决您的问题.

祝你好运,
—SA
You can do it all with System.Drawing. All you need is the class System.Drawing.Graphics and System.Drawing.Bitmap:
http://msdn.microsoft.com/en-us/library/system.drawing.bitmap.aspx[^],
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.aspx[^].

The idea is this: create a target bitmap of required size and pixel format and obtain and instance of System.Drawing.Graphics, and them draw on this bitmap whatever you want; in your problem, you will need to draw source bitmaps on the graphics of the target bitmap.

To create the instance of the new bitmap, see its constructors.

To obtain the instance of System.Drawing.Graphics of this bitmap, please use the static (factory) method System.Drawing.Graphics.FromImage:
http://msdn.microsoft.com/en-us/library/system.drawing.graphics.fromimage.aspx[^].

To draw another bitmap on the graphics of this bitmap, use one of the System.Drawing.Graphics.DrawImage methods.

Now you have all classes and methods to be used and all the references to MSDN help pages, this is more than enough to solve you problem.

Good luck,
—SA


这篇关于iam是否创建a,b,c,d等的位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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