Strict Standards: Non-static method utf_normalizer::nfc() should not be called statically in /www/htdocs/w006661d/anddev/includes/utf/utf_tools.php on line 1781
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 73: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 74: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 75: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 76: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 77: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
[phpBB Debug] PHP Notice: in file /bbc_download.php on line 78: Cannot modify header information - headers already sent by (output started at /includes/utf/utf_tools.php:1781)
// ## inside my resource container class // force the decodeResources to leave the pixel density at 1, regardless of target density BitmapFactory.Options ops = new BitmapFactory.Options(); ops.inDensity = 1; ops.inTargetDensity = 1; ops.inScreenDensity = 1; ops.inScaled = false; // load the background image Bitmap workBitmap = BitmapFactory.decodeResource(res, R.drawable.boardscreen, ops); Matrix scaleMatrix = new Matrix(); int originalSize = workBitmap.getWidth(); int newSize = displayMetrics.heightPixels; if (newSize > displayMetrics.widthPixels) { // we want the smaller of the two newSize = displayMetrics.widthPixels; } // figure out how much to scale the background by to fit on the screen ScaleBy = ((float)newSize) / originalSize; scaleMatrix.postScale(ScaleBy, ScaleBy); // scale the background image to fit the screen BitmapCollection[0] = Bitmap.createBitmap(workBitmap, 0, 0, originalSize, originalSize, scaleMatrix, true); workBitmap.recycle(); workBitmap = null; // calculate the size the sprites should be to be proportional to the background SPRITE_SIZE = (int) (64.0f * ScaleBy); // sprite frames are 64 x 64 pixels // load the sprite sheet bitmap workBitmap = BitmapFactory.decodeResource(res, R.raw.stones, ops); // rebuild each frame of the sprite sheet at the new scale BitmapCollection[1] = scaleAndRebuildSpriteSheet(workBitmap, 8, 8, 64, SPRITE_SIZE); workBitmap.recycle(); workBitmap = null; static public Bitmap scaleAndRebuildSpriteSheet(Bitmap originalBitmap, int framesAcross, int framesDown, int frameSize, int newFrameSize) { // Create bitmap to hold the new scaled sprite sheet Bitmap scaledSpriteSheet = Bitmap.createBitmap(framesAcross * newFrameSize, framesDown * newFrameSize, originalBitmap.getConfig()); // Create a work bitmap to hold the individual frames Bitmap frameBitmap = Bitmap.createBitmap(frameSize, frameSize, originalBitmap.getConfig()); // bitmap to hold a scaled down frame Bitmap scaledFrameBitmap = null; // pixel buffer to hold contents of original sprite sheet int pixelBuffer[] = new int[(framesAcross * frameSize) * (framesDown * frameSize)]; // pixel buffer for a single frame int pixelFrameBuffer[] = new int[frameSize * frameSize]; // pixel buffer for a scaled down frame int scaledFramePixelBuffer[] = new int[newFrameSize * newFrameSize]; // final pixel buffer to write each scaled down frame to int scaledPixelBuffer[] = new int[(framesAcross * newFrameSize) * (framesDown * newFrameSize)]; int originalBitmapWidth = originalBitmap.getWidth(); int newSpriteSheetWidth = scaledSpriteSheet.getWidth(); // Create scale matrix Matrix scaleMatrix = new Matrix(); float scaleFactor = ((float)newFrameSize) / frameSize; scaleMatrix.postScale(scaleFactor, scaleFactor); // buffer all the pixels from the original sprite sheet originalBitmap.getPixels(pixelBuffer,0,originalBitmapWidth, 0, 0, originalBitmapWidth, originalBitmap.getHeight()); // iterate through each frame in the sprite sheet for (int y = 0; y < framesDown; y ++) { for (int x = 0; x < framesAcross; x ++) { // copy the pixels for the current frame to the frame pixel buffer int pdx = 0; int sdx = 0; for (int yp = 0; yp < frameSize; yp ++) { for (int xp = 0; xp < frameSize; xp ++) { sdx = (xp + (x * frameSize)) + ((originalBitmapWidth) * yp) + (originalBitmapWidth * (frameSize * y) ); pixelFrameBuffer[pdx] = pixelBuffer[sdx]; pdx ++; } } // write those pixels to the frameBitmap frameBitmap.setPixels(pixelFrameBuffer, 0, frameSize, 0, 0, frameSize, frameSize); // scale the frame down to the new size we want scaledFrameBitmap = Bitmap.createBitmap(frameBitmap, 0, 0, frameSize, frameSize, scaleMatrix, true); // Buffer the scaled frame pixels scaledFrameBitmap.getPixels(scaledFramePixelBuffer,0,newFrameSize, 0, 0, newFrameSize, newFrameSize); // copy this frame to the final pixel buffer for (int yp = 0; yp < newFrameSize; yp ++) { for (int xp = 0; xp < newFrameSize; xp ++) { sdx = xp + (newFrameSize * yp); pdx = (xp + (x * newFrameSize)) + ((newSpriteSheetWidth) * yp) + (newSpriteSheetWidth * (newFrameSize * y) ); scaledPixelBuffer[pdx] = scaledFramePixelBuffer[sdx]; } } scaledFrameBitmap.recycle(); scaledFrameBitmap = null; } } // write the final pixel buffer to the final bitmap scaledSpriteSheet.setPixels(scaledPixelBuffer, 0, newSpriteSheetWidth, 0, 0, newSpriteSheetWidth, scaledSpriteSheet.getHeight()); return scaledSpriteSheet; }