亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? imageset.java

?? 大量j2me源代碼
?? JAVA
字號:
/**
 * A container for sets of image frames; typically sprites. A single set
 * is made up of one or more states. Each state represents an animation sequence
 * including Image objects for the frames, animation timing and frame dimensions.
 * <p>
 * An example use of this class would be to animate a little dude. If he had two
 * states of existence, standing (which has short breathing animation) and
 * walking (which has a much longer animation). This would be implemented by
 * creating an ImageSet object and then adding two states, each with their own
 * Image array for all the animation frames (use the static methods at the end
 * of this class to load a clipped file image and then extract the image frame
 * array from it). You can then use a Sprite class associated with this ImageSet
 * to draw the character to the screen as well as keep track of animation frames.
 * <p>
 * @see Sprite
 */

//#ifdef nokia
//# import com.nokia.mid.ui.DirectGraphics;
//# import com.nokia.mid.ui.DirectUtils;
//#endif
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.Graphics;
import java.io.IOException;

public class ImageSet
{
   private int totalStates;		// incremented by addState method only

   private Image[][] stateFrames;
   private int[] stateAnimTime, stateFrameWidth, stateFrameHeight;

   public ImageSet(int numStates)
   {
      stateAnimTime = new int[numStates];
      stateFrameWidth = new int[numStates];
      stateFrameHeight = new int[numStates];
      stateFrames = new Image[numStates][];
   }

   public final void addState(Image frames[], int animTime)
   {
      int state = totalStates++;

      if (state >= stateFrames.length)
      {
         // expand the number of states
         stateAnimTime = Tools.expandArray(stateAnimTime, 1);
         stateFrameWidth = Tools.expandArray(stateFrameWidth, 1);
         stateFrameHeight = Tools.expandArray(stateFrameHeight, 1);
         stateFrames = Tools.expandArray(stateFrames, 1);
      }

      stateAnimTime[state] = animTime;
      stateFrameWidth[state] = frames[0].getWidth();
      stateFrameHeight[state] = frames[0].getHeight();
      stateFrames[state] = frames;
   }

   public final int getTotalFrames(int state)
   {
      return stateFrames[state].length;
   }

   public final int getAnimTime(int state)
   {
      return stateAnimTime[state];
   }

   public final int getAnimTimePerFrame(int state)
   {
      return stateAnimTime[state] / stateFrames[state].length;
   }

   /**
    * Draw a specific frame of this sprite onto a graphics object
    */
   public final void draw(Graphics target, int state, int frame, int targetX, int targetY)
   {
      //#ifdef debug
      if (state >= totalStates)
         System.out.println("oops, bad state " + state);

      if (frame >= stateFrames[state].length)
         System.out.println("oops, bad frame " + frame + " in draw(" +
                            frame + ", " + state + ")");
      //#endif
      if (stateFrames[state][frame] != null)
         target.drawImage(stateFrames[state][frame],
                          targetX, targetY, Tools.GRAPHICS_TOP_LEFT);
   }

   /**
    * get a specific frame
    */
   public final Image getFrame(int state, int frame)
   {
      //#ifdef debug
      if (state >= totalStates)
         System.out.println("oops, bad state " + state);

      if (frame >= stateFrames[state].length)
         System.out.println("oops, bad frame " + state + ", " + frame + " in getFrame()");
      //#endif

      return stateFrames[state][frame];
   }

   /**
    * Get all frames as a single image
    * @param framesWide
    * @return an image with all frames; used to debug image files
    */
/*	public Image getAllFrames(int framesWide)
	{
		int numLines = (totalFrames / framesWide);
		if (numLines == 0) numLines = 1;

		Image result = Image.createImage(frameWidth * framesWide, frameHeight * numLines);
		Graphics g = result.getGraphics();

		int i = 0;
		for (int fy = 0; fy < numLines; fy++)
		{
			for (int fx = 0; fx < framesWide; fx++)
			{
				draw(g, i, 0 + (frameWidth * fx), fy * frameHeight);
				if (i < totalFrames - 1)
					i++;
			}
		}
		return result;
	}
*/

   //
   // STATIC IMAGE TOOLS
   //

   public final static Image loadClippedImage(String filename, int originX, int originY, int width,
                                              int height)
   {
      try
      {
         // load full image from file and create a mutable version
         Image fileImage = Image.createImage(filename);
         return getImageRegion(fileImage, originX, originY, width, height);
      }

      catch (IOException ioe)
      {
         System.out.println("can't load file: " + filename);
         return null;
      }
   }

   public final static Image loadClippedImage(String filename, int originX, int originY)
   {
      try
      {
         // load full image from file and create a mutable version
         Image fileImage = Image.createImage(filename);

         // shortcut out of here so we can avoid creating another image
         if (originX == 0 && originY == 0) return fileImage;

         return getImageRegion(fileImage, originX, originY, fileImage.getWidth(), fileImage.getHeight());
      }

      catch (IOException ioe)
      {
         System.out.println("can't load file: " + filename);
         return null;
      }
   }

   public final static Image getImageRegion(Image source, int x, int y, int width, int height)
   {
      // create a placeholder for our resulting image region
      Image result = null;

      //#ifdef nokia
      //# result = DirectUtils.createImage(width, height, 0x00000000);
      //#else
      result = Image.createImage(width, height);
      //#endif

      if (x + width > source.getWidth() || y + height > source.getHeight())
         System.out.println("Warning: attempting extract using (" +
                            x + "," + y + "," + width + "," + height + ") when image is " +
                            "(" + source.getWidth() + "," + source.getHeight() + ")");

      // draw the image, offset by the region starting position
      result.getGraphics().drawImage(source, -x, -y, Tools.GRAPHICS_TOP_LEFT);

      return result;
   }

   public final static Image[] extractFrames(Image sourceImage, int sourceX, int sourceY,
                                             int framesWide, int framesHigh,
                                             int frameWidth, int frameHeight)
   {
      // extract all the frames from the source image
      Image[] frames = new Image[framesWide * framesHigh];
      int frameCount = 0;

      for (int fy = 0; fy < framesHigh; fy++)
         for (int fx = 0; fx < framesWide; fx++)
            frames[frameCount++] =
                    getImageRegion(sourceImage, sourceX + (fx * frameWidth),
                                   sourceY + (fy * frameHeight),
                                   frameWidth, frameHeight);
      return frames;
   }


	////////////////////////////////////////////////////////////////////////////
	//
	//	NOKIA DEVICE SPECIFIC
	//
	////////////////////////////////////////////////////////////////////////////

	//#ifdef nokia
//# 
	//# /**
	 //# * Generates the axis reflections of an array of images; for example, for
	 //# * 1 image we return the vertical reflection, for 2 we return the vertical
	 //# * and horizontal reflections, for more we return the appropriate angles
	 //# * reflected. You should never pass in a source image not representing a
    //# * direction within the 0 to 90 degrees (anything else is just a reflection
    //# * of one of these). Images are always returned in clockwise order, ie. give
    //# * me degrees 0, 45 and 90 and you'll get back images for 0, 45, 90, 135,
    //# * 180, 225, 270, 315, 360.
	 //# *
	 //# * @param source array of source images
	 //# * @return clockwise array of images (including those from the source) using axis reflection
	 //# */
	//# public final static Image[] getAxisReflections(Image[] source)
	//# {
		//# int n = source.length;
		//# if (n == 0) return null;
//# 
		//# // figure the size of the result
		//# int total = (n - 1) * 4;
		//# // special case for simple reflections
		//# if (n < 3) total = n * 2;
//# 
		//# Image[] result = new Image[total];
//# 
		//# // copy the original images to the result
		//# for (int i = 0; i < n; i++)
			//# result[i] = source[i];
//# 
		//# // mirror the vertical (0 to 180)
		//# result[total / 2] = getReflectedImage(source[0], true, false);
//# 
		//# // mirror the horizontal (90 to 270)
		//# if (n > 1)
		//# {
			//# // you can think of total/4 as 90 degrees and total/2 as 180
			//# // keep in mind we're starting at 0 for array access
			//# result[total / 2 + (total / 4)] = getReflectedImage(source[n - 1], false, true);
		//# }
//# 
		//# // mirror everything between 0 and 90 to the three other quadrants
		//# if (n > 2)
		//# {
			//# // now this gets a little messy; we need to mirror everything
			//# // in between 0 and 90 to the other quadrants. Since N > 2 we know we
			//# // have at least 1 image we need to reflect. First let's figure out how
			//# // many there are in the first quadrant, minus the two axis we already
			//# // took care of.
			//# int f = (n - 2);
//# 
			//# // now we mirror these to their opposing sides for the other 3
			//# // quadrants
			//# for (int i = 1; i <= f; i++)
			//# {
				//# result[total / 2 - i] = getReflectedImage(source[i], true, false);
				//# result[total / 2 + i] = getReflectedImage(source[i], true, true);
				//# result[total - i] = getReflectedImage(source[i], false, true);
			//# }
		//# }
		//# return result;
	//# }
//# 
	//# /**
	 //# * Return an image reflected veritcally, horizontally or both
	 //# * @param source the original image to reflect
	 //# * @param flipHorizontal carry out a horizontal flip
	 //# * @param flipVertical carry out a vertical flip
	 //# * @return the reflected image
	 //# */
	//# public final static Image getReflectedImage(Image source, boolean flipHorizontal, boolean flipVertical)
	//# {
		//# Image result = DirectUtils.createImage(source.getWidth(), source.getHeight(), 0x00000000);
		//# DirectGraphics rdg = DirectUtils.getDirectGraphics(result.getGraphics());
//# 
		//# int flipType = 0;
		//# if (flipHorizontal) flipType |= DirectGraphics.FLIP_HORIZONTAL;
		//# if (flipVertical) flipType |= DirectGraphics.FLIP_VERTICAL;
//# 
		//# rdg.drawImage(source, 0, 0, Tools.GRAPHICS_TOP_LEFT, flipType);
		//# return result;
	//# }
	//#endif


}











?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品免费观看| 在线播放中文一区| 午夜激情一区二区三区| 久久久久久综合| 91久久奴性调教| 老司机精品视频导航| 亚洲一区在线视频观看| 久久精品免费在线观看| 欧美一区二区三区在线观看| 成人午夜激情影院| 久久不见久久见免费视频7| 亚洲天堂精品视频| 国产亚洲一二三区| 日韩免费观看2025年上映的电影 | 精品在线亚洲视频| 亚洲www啪成人一区二区麻豆| 国产精品成人在线观看| 欧美成人免费网站| 精品视频在线免费观看| www.亚洲国产| 国产精品亚洲人在线观看| 免费久久精品视频| 亚洲成a人v欧美综合天堂下载| 国产精品人人做人人爽人人添| 天堂成人国产精品一区| 亚洲日本免费电影| 国产日本亚洲高清| 精品国产凹凸成av人导航| 69av一区二区三区| 7799精品视频| 欧美老年两性高潮| 欧美性做爰猛烈叫床潮| 在线精品视频免费播放| 色噜噜久久综合| 91色综合久久久久婷婷| 北岛玲一区二区三区四区| 国产成人av影院| 国产成人综合在线播放| 精品一区二区三区的国产在线播放| 天使萌一区二区三区免费观看| 亚洲成人免费影院| 亚洲自拍偷拍综合| 亚洲电影一区二区三区| 亚洲国产精品一区二区尤物区| 亚洲一区二区三区在线看 | 日韩和的一区二区| 亚洲mv在线观看| 日本在线观看不卡视频| 免费观看一级欧美片| 捆绑紧缚一区二区三区视频 | 九九**精品视频免费播放| 久久99精品网久久| 国产高清在线精品| 粉嫩嫩av羞羞动漫久久久| 99这里都是精品| 欧美亚洲愉拍一区二区| 91精品国产一区二区| 日韩美一区二区三区| 久久久国产精华| 亚洲精品中文字幕乱码三区| 亚洲国产美女搞黄色| 久久国产麻豆精品| 国产99久久久精品| 色88888久久久久久影院按摩| 欧美日韩三级一区| 精品国偷自产国产一区| 国产精品色一区二区三区| 一区二区三区日韩精品视频| 日韩精品视频网| 国产成人超碰人人澡人人澡| 色8久久人人97超碰香蕉987| 在线不卡中文字幕播放| 久久一区二区三区四区| 亚洲欧美中日韩| 五月天精品一区二区三区| 国产精品资源在线| 欧美探花视频资源| 欧美成人高清电影在线| 国产精品久久久久久久久免费丝袜 | 欧美一区二区私人影院日本| 久久久久久久网| 一区二区三区自拍| 韩国三级中文字幕hd久久精品| 一本久久精品一区二区| 日韩视频一区二区在线观看| 中文字幕第一区第二区| 首页欧美精品中文字幕| 成人午夜在线播放| 91精品久久久久久久91蜜桃| 亚洲国产高清aⅴ视频| 天天综合色天天综合色h| 成人黄色网址在线观看| 欧美一区二区性放荡片| 综合久久久久综合| 国产在线不卡一区| 欧美肥妇free| 亚洲激情av在线| 国产一区二区三区电影在线观看| 91高清视频在线| 中文一区在线播放| 久久99精品久久只有精品| 欧美做爰猛烈大尺度电影无法无天| 国产午夜三级一区二区三| 免费成人美女在线观看| 色噜噜夜夜夜综合网| 中文一区二区在线观看| 久久国产精品99久久人人澡| 欧美视频一区二区三区四区 | 狠狠色伊人亚洲综合成人| 欧美天堂亚洲电影院在线播放| 国产精品国产三级国产普通话三级| 精品一区二区三区日韩| 欧美妇女性影城| 一级做a爱片久久| 成人性生交大片免费看中文| 欧美精品一区二区三区在线播放 | 136国产福利精品导航| 国产麻豆一精品一av一免费| 欧美精品色一区二区三区| 依依成人精品视频| 波多野结衣91| 国产精品麻豆99久久久久久| 国产丶欧美丶日本不卡视频| 久久亚洲影视婷婷| 精品在线免费视频| 2024国产精品| 精品在线播放午夜| 日韩精品一区二区三区老鸭窝| 日本美女一区二区三区视频| 欧美日韩国产一区二区三区地区| 亚洲欧美国产高清| 91久久精品日日躁夜夜躁欧美| 自拍偷拍国产亚洲| 99re免费视频精品全部| 中文字幕一区二区三区四区| 成人午夜私人影院| 最新国产精品久久精品| 色综合亚洲欧洲| 国产欧美一区二区在线| 国产尤物一区二区| 久久久久国产成人精品亚洲午夜| 韩国精品免费视频| 国产日韩欧美一区二区三区综合| 国产高清不卡二三区| 国产欧美日产一区| 99国产精品久久久久久久久久久| 亚洲人妖av一区二区| 91啪九色porn原创视频在线观看| 亚洲日本在线视频观看| 在线观看国产一区二区| 午夜欧美一区二区三区在线播放| 欧美人伦禁忌dvd放荡欲情| 免费人成在线不卡| 精品国产91久久久久久久妲己| 国产乱子轮精品视频| 国产精品欧美一级免费| 色视频成人在线观看免| 午夜视频在线观看一区二区 | 5月丁香婷婷综合| 极品少妇xxxx偷拍精品少妇| 欧美国产一区二区在线观看| 成人av电影在线观看| 亚洲一区在线观看视频| 欧美一区二区高清| 丰满亚洲少妇av| 亚洲一区二区三区四区不卡| 日韩欧美在线1卡| 成人久久视频在线观看| 亚洲午夜激情网站| 精品剧情在线观看| av不卡在线观看| 日韩在线播放一区二区| 国产午夜亚洲精品理论片色戒 | 成人一二三区视频| 亚洲高清在线视频| 欧美精品一区二区三| 日本精品一级二级| 日本成人在线网站| 欧美激情在线一区二区| 欧美日韩情趣电影| 国产一区二区91| 亚洲综合丝袜美腿| 欧美成人一区二区三区片免费| 不卡av在线免费观看| 免费的国产精品| 亚洲人成影院在线观看| 精品免费一区二区三区| 色偷偷久久一区二区三区| 激情都市一区二区| 亚洲小说欧美激情另类| 久久久亚洲欧洲日产国码αv| 欧美性大战久久久久久久蜜臀| 精品一区二区三区av| 亚洲国产中文字幕| 国产精品天干天干在线综合| 337p亚洲精品色噜噜狠狠| 97精品电影院| 国产成人99久久亚洲综合精品| 亚洲h精品动漫在线观看| 亚洲少妇屁股交4|