getWidth() 공개 메소드

public getWidth ( ) : int
리턴 int
예제 #1
0
		static void drawIntoBitmap (Bitmap bm)
		{
			float x = bm.getWidth ();
			float y = bm.getHeight ();
			Canvas c = new Canvas (bm);
			Paint p = new Paint ();
			p.setAntiAlias (true);

			p.setAlpha (0x80);
			c.drawCircle (x / 2, y / 2, x / 2, p);

			p.setAlpha (0x30);
			p.setXfermode (new PorterDuffXfermode (PorterDuff.Mode.SRC));
			p.setTextSize (60);
			p.setTextAlign (Paint.Align.CENTER);
			Paint.FontMetrics fm = p.getFontMetrics ();
			c.drawText ("Alpha", x / 2, (y - fm.ascent) / 2, p);
		}
예제 #2
0
		public BitmapMesh (Context context)
			: base (context)
		{
			mBitmap = GetResourceBitmap (R.drawable.beach);

			float w = mBitmap.getWidth ();
			float h = mBitmap.getHeight ();
			// construct our mesh
			int index = 0;
			for (int y = 0; y <= HEIGHT; y++) {
				float fy = h * y / HEIGHT;
				for (int x = 0; x <= WIDTH; x++) {
					float fx = w * x / WIDTH;
					setXY (mVerts, index, fx, fy);
					setXY (mOrig, index, fx, fy);
					index += 1;
				}
			}

			mMatrix.setTranslate (10, 10);
			mMatrix.invert (mInverse);
		}