Example #1
0
ZDCPixmap::ZDCPixmap(const ZDCPixmap& iSource, const ZRectPOD& iSourceBounds)
	{
	ZRef<ZDCPixmapRep> sourceRep = iSource.GetRep();
	if (not sourceRep)
		return;

	ZRectPOD originalBounds = sourceRep->GetBounds();

	ZRectPOD realBounds = (iSourceBounds + LT(originalBounds)) & originalBounds;
	if (sIsEmpty(realBounds))
		return;

	fRep = ZDCPixmapRep::sCreate(
		sourceRep->GetRaster(), realBounds, sourceRep->GetPixelDesc());
	}
Example #2
0
void ZDCPixmapRep::CopyFrom(ZPointPOD iDestLocation,
	const ZRef<ZDCPixmapRep>& iSourceRep, const ZRectPOD& iSourceBounds)
	{
	if (kDebug_Pixmap <= ZCONFIG_Debug)
		{
		ZAssertStop(kDebug_Pixmap, iSourceBounds == (iSourceBounds & iSourceRep->GetBounds()));

		ZRectPOD destBounds = iSourceBounds + (iDestLocation - LT(iSourceBounds));
		ZAssertStop(kDebug_Pixmap, destBounds == (destBounds & fBounds));
		}

	ZDCPixmapNS::sBlit(
		iSourceRep->GetRaster()->GetBaseAddress(),
		iSourceRep->GetRaster()->GetRasterDesc(),
		iSourceRep->GetPixelDesc(),
		fRaster->GetBaseAddress(),
		fRaster->GetRasterDesc(),
		this->GetPixelDesc(),
		iSourceBounds,
		iDestLocation);
	}