// COPYRIGHT (C) 1990-1999.  All Rights Reserved. - BITMAP1.CPP
// Zinc Software Incorporated.  Pleasant Grove, Utah  USA
// May be freely copied, used and distributed.

#include <zaf.hpp>
#include "bitmap1.hpp"

// Constructor for the MyBitmap class
MyBitmap::MyBitmap(void) : ZafWindowObject(20, 15, 64, 64)
{
	// Initialize the first bitmap.
	bitmapData = new ZafBitmapData(ZAF_ITEXT("WORLD_6"), *zafDataPersistence);

	// Set the coordinate type and other attributes.
	SetCoordinateType(ZAF_PIXEL);
	SetOSDraw(false);
	SetBordered(false);
	SetNoncurrent(true);
}

MyBitmap::~MyBitmap()
{
	delete bitmapData;
}

#if defined(ZAF_DEFAULT_DRAW)
// The Draw function for the bitmap.
ZafEventType MyBitmap::Draw(const ZafEventStruct &, ZafEventType ccode)
{
	ZafRegionStruct region = BeginDraw();

	zafDisplay->Bitmap(region.left, region.top, *bitmapData);

	EndDraw();
	return (ccode);
}
#endif

