当前位置: 首页>>代码示例>>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;未经允许,请勿转载。