當前位置: 首頁>>代碼示例>>Java>>正文


Java BitmapHelper類代碼示例

本文整理匯總了Java中com.threed.jpct.util.BitmapHelper的典型用法代碼示例。如果您正苦於以下問題:Java BitmapHelper類的具體用法?Java BitmapHelper怎麽用?Java BitmapHelper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BitmapHelper類屬於com.threed.jpct.util包,在下文中一共展示了BitmapHelper類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: loadTexture

import com.threed.jpct.util.BitmapHelper; //導入依賴的package包/類
private static void loadTexture(String textureName, int id){
		int count = 0;
		OutOfMemoryError exc = null;
		do{
			try{
				Bitmap texture = BitmapHelper.convert(FlagWallpaperService.context.getResources().getDrawable(id));
//				if(textureName.startsWith(SKY)){
//					WallpaperManager wallpaperManager = WallpaperManager.getInstance(FlagWallpaperService.context);
//					int target = BitmapUtils.getBestFittingScreenPow(wallpaperManager.getDesiredMinimumWidth(), wallpaperManager.getDesiredMinimumHeight());
//					texture = BitmapUtils.transform(new Matrix(), texture, target, target, true);
////					texture = getBitmap(id, target);
//					Log.i("CROP", "Cropped: "+textureName +" "+texture.getWidth()+"x"+texture.getHeight() +", " +texture.getRowBytes() * texture.getHeight()+"bytes");
//				}else;
//					texture = BitmapHelper.convert(FlagWallpaperService.context.getResources().getDrawable(id));
				loadTexture(textureName, texture);
				
			}catch (OutOfMemoryError e) {
				Log.e("FlagManger", "OutOfMemoryError while loadind "+textureName);
				exc = e;
				System.gc();
			}
		}while(exc!=null && ++count<5);

	}
 
開發者ID:danilox6,項目名稱:flag3dlivewallpaperbase,代碼行數:25,代碼來源:FlagManager.java

示例2: onSurfaceChanged

import com.threed.jpct.util.BitmapHelper; //導入依賴的package包/類
public void onSurfaceChanged(GL10 gl, int w, int h) {
            if (fb != null) {
                fb.dispose();
            }
            fb = new FrameBuffer(gl, w, h);

            if (master == null) {

                world = new World();
                world.setAmbientLight(20, 20, 20);

                sun = new Light(world);
                sun.setIntensity(250, 250, 250);

                // Create a texture out of the icon...:-)
                Texture texture = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.drawable.icon)), 64, 64));
                Texture sky_tex = new Texture(BitmapHelper.rescale(BitmapHelper.convert(getResources().getDrawable(R.raw.sky)), 64, 64));
                TextureManager.getInstance().addTexture("texture", texture);
                TextureManager.getInstance().addTexture("sky", sky_tex);

				/*cube = Primitives.getCube(10);
				cube.calcTextureWrapSpherical();
				cube.setTexture("texture");
				cube.strip();
				cube.build();
*/
                //world.addObject(cube);

                //sky = new SkyBox("sky", "sky", "sky", "sky", "sky", "sky", 90.0f);


                objects = Scene.loadLevelAE("test.txt", objects, world, assetManager);
                cube = Scene.findObject("barrel", objects);
                cube.scale(10.0f);
                world.addObject(cube);

                Camera cam = world.getCamera();
                cam.moveCamera(Camera.CAMERA_MOVEOUT, 50);
                cam.lookAt(cube.getTransformedCenter());

                SimpleVector sv = new SimpleVector();
                sv.set(cube.getTransformedCenter());
                sv.y -= 100;
                sv.z -= 100;
                sun.setPosition(sv);
                MemoryHelper.compact();

                if (master == null) {
                    Logger.log("Saving master Activity!");
                    master = MyWallpaperService.this;
                }
            }
        }
 
開發者ID:dns,項目名稱:LiveWallpaper3D-jPCT-AE,代碼行數:54,代碼來源:MyWallpaperService.java


注:本文中的com.threed.jpct.util.BitmapHelper類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。