Ejemplo n.º 1
0
Bitmap::Bitmap(int xsize, int ysize, const PixelFormat& pxf)
{
	assert( xsize > 0 && ysize > 0 );

	width  = xsize;
	height = ysize;
	pitch  = width * pxf.GetBytes();
	format = pxf;
	image  = new uint8[height*pitch];
}
Ejemplo n.º 2
0
void Bitmap::SetImage(int xsize, int ysize, const PixelFormat& pxf, void* i)
{
	assert( xsize > 0 && ysize > 0 );

	delete[] image;	

	width  = xsize;
	height = ysize;
	pitch  = xsize * pxf.GetBytes();
	format = pxf;
	image  = reinterpret_cast<uint8*>(i);
}