嵌入式程序

源代码在线查看: pictures.cs

软件大小: 1846 K
上传用户: xiao11tian
关键词: 嵌入式程序
下载地址: 免注册下载 普通下载 VIP

相关代码

				using System;
				using System.Drawing;
				
				namespace DiamondPet.UserLayer
				{
					/// 
					/// Pictures 的摘要说明。
					/// 
					public class Pictures
					{
						/// 
						/// 图片
						/// 
						public static Image[] picturesImage;
				
						/// 
						/// 第一张图片
						/// 
						private static Image firstImage;
				
						/// 
						/// 图片名
						/// 
						private static string[] picName;
						
						public Pictures()
						{}
				
						/// 
						/// 加载第一张图片
						/// 
						public static void LoadFirstPicture()
						{}
				
				
						#region 生成图片文件名
						/// 
						/// 图片的文件名
						/// 
						public static void GetPicturesName()
						{
							//图片的文件名
							picName = new string[]{"block1.png","block2.png","block3.png","block4.png","block5.png","block6.png","block7.png","number.png","property1.png","property2.png","score.png","starb.png","stars.png","background.png","btstart.png","btoption.png","bthighscore.png","bthelp.png","btexit.png","btstarton.png","btoptionon.png","bthighscoreon.png","bthelpon.png","btexiton.png","mainbg.png","continue.png","exitgame.png","exitpro.png","continueon.png","exitgameon.png","exitproon.png","blockcolor.png","bomb.png","lightening.png","wugui.png","levelup.png","gameover.png","helpbg.png","helptitle.png","highscoretitle.png","optiontitle.png","timeandspeed.png"};
						}
						#endregion
				
						#region 加载图片
						/// 
						/// load图片
						/// 
						public static bool LoadPictures()
						{
							try
							{
								for(int i = 0;i < picName.Length;++i)
								{
									picturesImage[i] = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("DiamondPet.pic."+picName[i]));
								}
							}
							catch
							{
						    	//加载错误
								return false;
							}
							//加载正确
							return true;
						}
						#endregion
				
						#region 得到加载图片的张数
						/// 
						/// 得到加载图片的张数
						/// 
						public static void GetPicNumbers()
						{		
				    		//定义图片的张数
							picturesImage = new Image[picName.Length];
						}
						#endregion
					}
				}
							

相关资源