GF4J 0.9.4 Beta

gameframe.graphics
Class BitmapFile

java.lang.Object
  |
  +--gameframe.graphics.BitmapFile

public class BitmapFile
extends java.lang.Object

Represents Windows Bitmap (BMP) file and has utility methods for loading a Windows Bitmap file and returning its bitmap data.

Since:
GameFrame for Java 0.9.3
Version:
GameFrame for Java 0.9.4
Author:
Pasi Keränen 16. Feb 2000

Constructor Summary
BitmapFile()
           
 
Method Summary
 boolean imageUpdate(java.awt.Image img, int infoflags, int x, int y, int width, int height)
          The image observer method that gets updated when an image is loading.
static BitmapData loadBMP(java.io.InputStream inStream, java.lang.String strFileName, boolean fEnableAlpha)
          Handles the loading of the bitmap from the given input stream.
static BitmapData loadBMP(java.io.InputStream inStream, java.lang.String strFileName, byte alphakeyRed, byte alphakeyGreen, byte alphakeyBlue)
          Handles the loading of the bitmap from the given input stream.
static BitmapData loadBMP(java.lang.String strFileName, boolean fEnableAlpha)
          Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
static BitmapData loadBMP(java.lang.String strFileName, byte red, byte green, byte blue)
          Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
static BitmapData loadBMPURL(java.lang.String strFileName, boolean fEnableAlpha)
          Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
static BitmapData loadBMPURL(java.lang.String strFileName, byte red, byte green, byte blue)
          Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
static void saveBMP(java.lang.String strFileName, BitmapData bitmapData)
          Saves the given bitmap to a Windows BMP formatted file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BitmapFile

public BitmapFile()
Method Detail

imageUpdate

public boolean imageUpdate(java.awt.Image img,
                           int infoflags,
                           int x,
                           int y,
                           int width,
                           int height)
The image observer method that gets updated when an image is loading.

saveBMP

public static void saveBMP(java.lang.String strFileName,
                           BitmapData bitmapData)
                    throws GameFrameException
Saves the given bitmap to a Windows BMP formatted file.
Parameters:
strFileName - The name of the file to save to.
bitmapData - The bitmap data (width, height and raw pixel data).

loadBMPURL

public static final BitmapData loadBMPURL(java.lang.String strFileName,
                                          boolean fEnableAlpha)
                                   throws java.io.FileNotFoundException,
                                          GameFrameException
Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
Parameters:
strFileName - The name of the file to load.
fEnableAlpha - True if bitmap is to be loaded as alpha bitmap.
Returns:
The bitmap data (width, height and raw pixel data).

loadBMPURL

public static final BitmapData loadBMPURL(java.lang.String strFileName,
                                          byte red,
                                          byte green,
                                          byte blue)
                                   throws java.io.FileNotFoundException,
                                          GameFrameException
Loads the file at the given URL containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
Parameters:
strFileName - The name of the file to load.
red - The red key color intensity value (in range 0x00-0xFF).
green - The green key color intensity value (in range 0x00-0xFF).
blue - The blue key color intensity value (in range 0x00-0xFF).
Returns:
The bitmap data (width, height and raw pixel data).

loadBMP

public static final BitmapData loadBMP(java.lang.String strFileName,
                                       boolean fEnableAlpha)
                                throws java.io.FileNotFoundException,
                                       GameFrameException
Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
Parameters:
strFileName - The name of the file to load.
fEnableAlpha - True if bitmap is to be loaded as alpha bitmap.
Returns:
The bitmap data (width, height and raw pixel data).

loadBMP

public static final BitmapData loadBMP(java.lang.String strFileName,
                                       byte red,
                                       byte green,
                                       byte blue)
                                throws java.io.FileNotFoundException,
                                       GameFrameException
Loads the given file containing a Windows BMP formatted bitmap and returns an object containing the raw pixel data and the dimensions of the loaded bitmap.
Parameters:
strFileName - The name of the file to load.
red - The red key color intensity value (in range 0x00-0xFF).
green - The green key color intensity value (in range 0x00-0xFF).
blue - The blue key color intensity value (in range 0x00-0xFF).
Returns:
The bitmap data (width, height and raw pixel data).

loadBMP

public static final BitmapData loadBMP(java.io.InputStream inStream,
                                       java.lang.String strFileName,
                                       boolean fEnableAlpha)
                                throws java.io.FileNotFoundException,
                                       GameFrameException
Handles the loading of the bitmap from the given input stream.
Parameters:
inStream - The input stream to load from.
strFileName - The filename used in error texts.
fEnableAlpha - Flag indicating if key color should be used or not.

loadBMP

public static final BitmapData loadBMP(java.io.InputStream inStream,
                                       java.lang.String strFileName,
                                       byte alphakeyRed,
                                       byte alphakeyGreen,
                                       byte alphakeyBlue)
                                throws java.io.FileNotFoundException,
                                       GameFrameException
Handles the loading of the bitmap from the given input stream.
Parameters:
inStream - The input stream to load from.
strFileName - The filename used in error texts.
alphakeyRed - The red alpha key value (in range 0x00-0xFF).
alphakeyGreen - The green alpha key value (in range 0x00-0xFF).
alphakeyBlue - The blue alpha key value (in range 0x00-0xFF).

GF4J 0.9.4 Beta