Ejemplo n.º 1
0
void CStatusWindow::Construct(CTestBase* aTest)
	{
	_LIT(Title,"StatusWindow");
	_LIT(String4,"Click here to finish");
	iTest=aTest;
	TWindowTitle title(Title);
	SetTitle(title);
	TInt yy=iTitleHeight+iFont->HeightInPixels()+7;
	iRect1.SetRect(3,iTitleHeight+5,iSize.iWidth-1,yy);
	TInt yy1=yy+iFont->HeightInPixels()+2;
	iRect2.SetRect(3,yy+3,iSize.iWidth-1,yy1);
	TInt yy2=yy1+iFont->HeightInPixels()+2;
	iRect3.SetRect(3,yy1+3,iSize.iWidth-1,yy2);
	iRect4.SetRect(3,yy2+3,iSize.iWidth-1,yy2+iFont->HeightInPixels()+2);
	TMachineInfoV1Buf machineInfo;
	UserHal::MachineInfo(machineInfo);
	iXyInputType=machineInfo().iXYInputType;
	iOriginalXyInputType=iXyInputType;
	iSimulatedPenDown=EFalse;
	//
	iString3.Copy(KNullDesC);
	if (iXyInputType==EXYInputDeltaMouse)
		{
		if (HAL::Get(HALData::EMouseState,iSimulatedPenDown)==KErrNone)
			UpdateString3();
		}
	UpdateString1();
	iMode=Client()->iWs.PointerCursorMode();
	iOriginalMode=iMode;
	UpdateString2();
	iUpdateNeeded=EFalse;
	iString4.Copy(String4);
	iExit=EFalse;
	}
Ejemplo n.º 2
0
void CTerminalContainer::GetTerminalRect(TRect &aRect) {
    
    // Get font dimensions
    TInt fontHeight = iFont->FontSize().iHeight;
    TInt fontWidth = iFont->FontSize().iWidth;

    // Terminal maximum size
    TInt termWidth = Rect().Width();
    TInt termHeight = Rect().Height();

    // Round size down to the largest possible terminal that contains whole
    // characters
    termWidth = fontWidth * (termWidth / fontWidth);
    termHeight = fontHeight * (termHeight / fontHeight);
    // The following condition should only be met in the very specific case
    // where an e90 user with 800x352 screen, uses the 14point font designed
    // explicitly for a 80x24 screen size.
    if (fontHeight == 14 && fontWidth == 10 && termWidth == 800) {
        termHeight = 24 * fontHeight;
    }
    assert((termWidth > 0) && (termHeight > 0));

    // Set terminal size and position
    TInt termX = Rect().iTl.iX + (Rect().Width() - termWidth) / 2;
    TInt termY = Rect().iTl.iY + (Rect().Height() - termHeight) / 2;
    aRect.SetRect(TPoint(termX, termY), TSize(termWidth, termHeight));
}
Ejemplo n.º 3
0
void CWordTest::DrawBackground(const TParam& aParam,const TRgb& aBackground,TRect& aDrawn) const
{
    if (iBackgroundBitmap)
    {
        aParam.iGc.SetClippingRect(aParam.iDrawRect);
        aDrawn.SetRect(aParam.iTextLayoutTopLeft,iBackgroundBitmap->SizeInPixels());
        aParam.iGc.DrawBitmap(aDrawn,iBackgroundBitmap);
    }
    else
        MFormCustomDraw::DrawBackground(aParam,aBackground,aDrawn);
}
Ejemplo n.º 4
0
//Gets the actual orientation based refresh rect required from a 'physical' screen reference.
TRect RWindows::GetOrientedRect(const TRect &aScreenRect)
	{	
	TRect orientedRect;	
	
	switch(iOrientation)		
	{
		case 1:
			{
			orientedRect.SetRect(aScreenRect.iTl.iY, 		
								 iEpocBitmapSize.iWidth-aScreenRect.iBr.iX, 
								 aScreenRect.iBr.iY,
								 iEpocBitmapSize.iWidth-aScreenRect.iTl.iX);	
			break;
			}
		case 2:
			{	
			orientedRect.SetRect(iEpocBitmapSize.iWidth-aScreenRect.iBr.iX,
								 iEpocBitmapSize.iHeight-aScreenRect.iBr.iY, 							 
								 iEpocBitmapSize.iWidth-aScreenRect.iTl.iX,
								 iEpocBitmapSize.iHeight-aScreenRect.iTl.iY);
			break;
			}
		case 3:
		{
			orientedRect.SetRect(iEpocBitmapSize.iHeight-aScreenRect.iBr.iY, 		
								 aScreenRect.iTl.iX, 
							 	 iEpocBitmapSize.iHeight-aScreenRect.iTl.iY,
							 	 aScreenRect.iBr.iX);
			break;
		}		
		default:
		{
			orientedRect = aScreenRect;
			break;				
		} 
	}
	
	return orientedRect;	
	}
Ejemplo n.º 5
0
void TDrawer::DrawReturnArrow(CWsBitmap* aBackUpBitmap, CWsBitmap* aResourceBitmap, TRect aWorldPointRect,
                              TRect aBitMapRect)
{
    //根据WorldPointRect大小 和 aBitMapRect的大小 设置新的returnRect的大小
    TPoint center;
    center.SetXY((aWorldPointRect.iBr.iX + aWorldPointRect.iTl.iX) / 2, (aWorldPointRect.iBr.iY
                 + aWorldPointRect.iTl.iY) / 2);
    TInt iHalfHigh = (aBitMapRect.iBr.iY - aBitMapRect.iTl.iY) / 2;
    TInt iHalfWidth = (aBitMapRect.iBr.iX - aBitMapRect.iTl.iX) / 2;
    TRect centerRect;
    centerRect.SetRect(center.iX - iHalfWidth, center.iY - iHalfHigh, center.iX + iHalfWidth, center.iY + iHalfHigh);

    TBitmapUtil objectUtil(aResourceBitmap);
    TBitmapUtil backUpUtil(aBackUpBitmap);
    //
    objectUtil.Begin(TPoint(0, 0));
    backUpUtil.Begin(TPoint(0, 0));
    R8G8B8* addr1 = (R8G8B8*) aResourceBitmap->DataAddress();// 对象
    R8G8B8* addr2 = (R8G8B8*) aBackUpBitmap->DataAddress();// 背景
    TSize desSize = aBackUpBitmap->SizeInPixels();
    TSize srcSize = aResourceBitmap->SizeInPixels();
    R8G8B8* addr22;
    R8G8B8* addr11;
    addr22 = addr2 + (centerRect.iTl.iY - 1) * desSize.iWidth + centerRect.iTl.iX;
    TSize newSize = centerRect.Size();
    addr11 = addr1 + aBitMapRect.iTl.iY * srcSize.iWidth + aBitMapRect.iTl.iX;
    //每画完一行,arrd11要前进的距离
    TInt iWidthSpan = srcSize.iWidth - newSize.iWidth;
    TInt iScreenWidthSpan = desSize.iWidth - newSize.iWidth;
    for (TInt j = 0; j < newSize.iHeight; j++)
    {
        for (TInt i = 0; i < newSize.iWidth; i++)
        {
            *addr22 = *addr11;
            addr22++;
            addr11++;
        }
        addr11 = addr11 + iWidthSpan;
        addr22 = addr22 + iScreenWidthSpan;
    }
    backUpUtil.End();
    objectUtil.End();
}
Ejemplo n.º 6
0
TBool CDataWrapperBase::GetRectFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRect& aResult)
	{
	TBuf<KMaxTestExecuteCommandLength>	tempStore;

	TInt	top;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectTop);
	TBool	ret=GetIntFromConfig(aSectName, tempStore, top);

	TInt	left;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectLeft);
	if ( !GetIntFromConfig(aSectName, tempStore, left) )
		{
		ret=EFalse;
		}

	TInt	bottom;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectBottom);
	if ( !GetIntFromConfig(aSectName, tempStore, bottom) )
		{
		ret=EFalse;
		}

	TInt	right;
	tempStore.Format(KFormatEntryField, &aKeyName, &KTagRectRight);
	if ( !GetIntFromConfig(aSectName, tempStore, right) )
		{
		ret=EFalse;
		}

	if ( ret )
		{
		aResult.SetRect(left, top, right, bottom);
		}

	return ret;
	}
TInt COpenWFC_RI_DisplayUpdater::UpdateDisplay()
    {
    TInt err = KErrNone;

    SymbianStreamBuffer readBuffer = iNextReadBuffer;
    iNextReadBuffer = SYMBIAN_INVALID_HANDLE;
    if (!iNextSceneStream)
        {
        LOG((" !!! COpenWFC_RI_DisplayUpdater::UpdateDisplay() ASSERT: No top layer has been set!"));
        return KErrNotReady;
        }
    if (readBuffer == SYMBIAN_INVALID_HANDLE)
        {
        if ((err = SymbianStreamAcquireReadBuffer(iNextSceneStream, &readBuffer)) != KErrNone)
            {   //AcquireReadBuffer "Can't fail" in theory, but just incase....
            LOG((" !!! COpenWFC_RI_DisplayUpdater::UpdateDisplay() Acquire failed: %d", err));
            return err;
            }
        }
    TBufferInfo bufferInfo;
    khronos_int32_t width, height, stride;
    SymbianStreamGetHeader(iNextSceneStream, &width, &height, &stride, NULL, NULL);
    bufferInfo.iBufferWidth = (TInt16)width;
    bufferInfo.iBufferHeight = (TInt16)height;
    bufferInfo.iStride = (TInt16)stride;
    bufferInfo.iBufferFormat = EPixelFormatXRgb8888Le;
    bufferInfo.iLinearAddress = 0;
    err = SymbianStreamGetBufferPointer(iNextSceneStream, readBuffer,&bufferInfo.iLinearAddress);
    if (err == KErrNone)
        {
        err = SymbianStreamGetChunkHandle(iNextSceneStream, &bufferInfo.iBufferRChunkHandle);
        }

    if (err != KErrNone)
        {
        LOG((" !!! COpenWFC_RI_DisplayUpdater::UpdateDisplay() error %d getting stream data", err));
        SymbianStreamReleaseReadBuffer(iNextSceneStream, readBuffer);
        return err;
        }

    TRect displayRect;
    displayRect.SetRect(TPoint(0, 0), TSize(bufferInfo.iBufferWidth, bufferInfo.iBufferHeight ));
    
    TDisplayViewSettings viewSettings; // Default
    viewSettings.iSourceScissor         = displayRect;
    viewSettings.iDestinationScaledRect = displayRect;
    viewSettings.iLayerRotation         = ERotate0Deg;
    viewSettings.iUsageHint             = EPurposeUi;
    viewSettings.iTearingFree           = ETrue;
      
    LOG((" $$$*** bufferInfo.iBufferWidth %d", bufferInfo.iBufferWidth));
    LOG((" $$$*** bufferInfo.iBufferHeight %d", bufferInfo.iBufferHeight));
    LOG((" $$$*** bufferInfo.iStride %d", bufferInfo.iStride));
    LOG((" $$$*** bufferInfo.iBufferFormat %d", bufferInfo.iBufferFormat));
    LOG((" $$$*** bufferInfo.iLinearAddress %08x", bufferInfo.iLinearAddress));
    LOG((" $$$*** bufferInfo.iBufferRChunkHandle %d", bufferInfo.iBufferRChunkHandle));

    LOG((" $$$*** viewSettings iSourceScissor width %d", viewSettings.iSourceScissor.Width()));
    LOG((" $$$*** viewSettings iSourceScissor height %d", viewSettings.iSourceScissor.Height()));
    LOG((" $$$*** viewSettings iDestinationScaledRect width %d", viewSettings.iDestinationScaledRect.Width()));
    LOG((" $$$*** viewSettings iDestinationScaledRect height %d", viewSettings.iDestinationScaledRect.Height()));
    LOG((" $$$*** viewSettings iLayerRotation %d", viewSettings.iLayerRotation));
    LOG((" $$$*** viewSettings iUsageHint %d", viewSettings.iUsageHint));
    LOG((" $$$*** viewSettings iTearingFree %d", viewSettings.iTearingFree));

    TRequestStatus completedWhenReady = KRequestPending;
    viewSettings.iLayerRotation = iCurrentRotation;

    err = iDisplayUpdater->SetView(KTopMostLayer, viewSettings, bufferInfo);
    
    if (err != KErrNone)
        {
        LOG((" !!! COpenWFC_RI_DisplayUpdater::UpdateDisplay()ERROR: Display update set view failed %d", err));
        }
    else
        {
        err = iDisplayUpdater->SetBuffer(KTopMostLayer, displayRect, bufferInfo );
        if (err != KErrNone)
            {
            LOG((" !!! COpenWFC_RI_DisplayUpdater::UpdateDisplay()ERROR: Display Update set buffer failed %d", err));
            }
        }

    ////////////////////////////////////////////////////////////////////////////////////////////
    iDisplayUpdater->Flush(completedWhenReady);
    
    /* The TRequestStatus& aCompletedWhenReady parameter is signalled 
     * either when the buffer has been copied, 
     * or it is streaming the first pixel to the display
     * In either case this indicates that the previous buffer is no longer required.
     * By waiting here we guarantee that the previous iCurrentReadBuffer is no longer required,
     * but here are more intelligent ways to wait, I am sure!
     */
    User::WaitForRequest(completedWhenReady);
    if (iCurrentReadBuffer != SYMBIAN_INVALID_HANDLE)
        {
        // Release the previous update's read buffer.
        /* This ensures that a lock is held on the displayed buffer until the next commit/compose
         * This is correct behaviour for streaming direct to the display, but is actually not
         * necessary if the display makes its own copy.
         * However, PlatSim currently supports only the latter, and we think the former is important,
         * so this implementation allows us to validate that the behaviour is correct in direct streaming.
         */
        SymbianStreamReleaseReadBuffer(iCurrentSceneStream, iCurrentReadBuffer);
        }
    iCurrentReadBuffer = readBuffer;
    iCurrentSceneStream = iNextSceneStream;
    return err;
    }
Ejemplo n.º 8
0
void CSpriteSet::RenderSprite(TInt aSpriteType, TInternalSpriteResizeMode aInternalSpriteResizeMode, const TSize& aSourceSize, const TSize& aSpriteSize)
	{
	const TInt sourceWidth = aSourceSize.iWidth;
	const TInt sourceHeight = aSourceSize.iHeight;
	const TInt spriteWidth = aSpriteSize.iWidth;
	const TInt spriteHeight = aSpriteSize.iHeight;
	const TInt numOfHorizAddedLines = spriteHeight-sourceHeight;
	const TInt numOfVertAddedLines = spriteWidth-sourceWidth;
	const TPoint posZeroZero(0,0);	// cached for repeated use
	CGulIcon* spriteSetMember = iSourceMembers[aSpriteType];
	CFbsBitmap* bitmapToUse = spriteSetMember->Bitmap();
	CFbsBitmap* maskToUse = spriteSetMember->Mask();
	TRect fromRect;
	TPoint toPoint;

	switch(aInternalSpriteResizeMode)
		{
	case EHSameVSame:
		{
		fromRect.SetRect(0,0,sourceWidth,sourceHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		break;
		}
	case EHSameVShrink:
		{
		const TInt halfSpriteHeight = spriteHeight/2;
		fromRect.SetRect(0,0,spriteWidth,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(0,sourceHeight - (halfSpriteHeight) - (spriteHeight%2),sourceWidth,sourceHeight);
		toPoint.SetXY(0,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		break;
		}
	case EHSameVStretch:
		{
		const TInt halfSourceHeight = sourceHeight/2;
		fromRect.SetRect(0,0,sourceWidth,halfSourceHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(0,halfSourceHeight,sourceWidth,sourceHeight);
		toPoint.SetXY(0,spriteHeight-(halfSourceHeight)-(sourceHeight%2));
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		for(TInt i = 0; i < numOfHorizAddedLines;i++)
			{
			fromRect.SetRect(0,halfSourceHeight,sourceWidth,(halfSourceHeight)+1);
			toPoint.SetXY(0,(halfSourceHeight)+i);
			iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
			iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
			}
		break;
		}
	case EHShrinkVSame:
		{
		const TInt halfSpriteWidth = spriteWidth/2;
		fromRect.SetRect(0,0,halfSpriteWidth,spriteHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSpriteWidth) - (spriteWidth%2),0,sourceWidth,sourceHeight);
		toPoint.SetXY(halfSpriteWidth,0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		break;
		}
	case EHShrinkVShrink:
		{
		const TInt halfSpriteWidth = spriteWidth/2;
		const TInt halfSpriteHeight = spriteHeight/2;
		const TInt spriteHeightModTwo = spriteHeight%2;
		const TInt spriteWidthModTwo = spriteWidth%2;
		fromRect.SetRect(0,0,halfSpriteWidth,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSpriteWidth) - (spriteWidthModTwo),0,sourceWidth,halfSpriteHeight);
		toPoint.SetXY(halfSpriteWidth,0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(0,sourceHeight - (halfSpriteHeight) - (spriteHeightModTwo),halfSpriteWidth,sourceHeight);
		toPoint.SetXY(0,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSpriteWidth) - (spriteWidthModTwo),sourceHeight - (halfSpriteHeight) - (spriteHeightModTwo),sourceWidth,sourceHeight);
		toPoint.SetXY(halfSpriteWidth,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		break;
		}
	case EHShrinkVStretch:
		{
		const TInt halfSourceHeight = sourceHeight/2;
		const TInt halfSpriteWidth = spriteWidth/2;
		const TInt sourceHeightModTwo = sourceHeight%2;
		const TInt spriteWidthModTwo = spriteWidth%2;
		fromRect.SetRect(0,0,halfSpriteWidth,halfSourceHeight);	
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSpriteWidth) - (spriteWidthModTwo),0,sourceWidth,halfSourceHeight);
		toPoint.SetXY(halfSpriteWidth,0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(0,sourceHeight - (halfSourceHeight) - (sourceHeightModTwo),halfSpriteWidth,sourceHeight);
		toPoint.SetXY(0,spriteHeight - (halfSourceHeight) - (sourceHeightModTwo));
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSpriteWidth) - (spriteWidthModTwo),sourceHeight - (halfSourceHeight) - (sourceHeightModTwo),sourceWidth,sourceHeight);
		toPoint.SetXY(halfSpriteWidth,spriteHeight - (halfSourceHeight) - (sourceHeightModTwo));
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		for(TInt j = 0; j < numOfHorizAddedLines;j++)
			{
			fromRect.SetRect(0,spriteHeight - (halfSourceHeight) - (sourceHeightModTwo),spriteWidth,spriteHeight - (halfSourceHeight) - (sourceHeightModTwo)+1);
			toPoint.SetXY(0,(halfSourceHeight)+j);
			iMainFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			iMaskFbsBitGc->BitBlt(toPoint,iTargetMaskBitmap,fromRect);
			}
		break;
		}
	case EHStretchVSame:
		{
		const TInt halfSourceWidth = sourceWidth/2;
		fromRect.SetRect(0,0,halfSourceWidth,sourceHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(halfSourceWidth,0,sourceWidth,sourceHeight);
		toPoint.SetXY(spriteWidth-(halfSourceWidth)-(sourceWidth%2),0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		for(TInt i = 0; i < numOfVertAddedLines;i++)
			{
			fromRect.SetRect(halfSourceWidth,0,(halfSourceWidth)+1,sourceHeight);
			toPoint.SetXY((halfSourceWidth)+i,0);
			iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
			iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
			}
		break;
		}
	case EHStretchVShrink:
		{
		const TInt halfSourceWidth = sourceWidth/2;
		const TInt halfSpriteHeight = spriteHeight/2;
		const TInt sourceWidthModTwo = sourceWidth%2;
		const TInt spriteHeightModTwo = spriteHeight%2;
		fromRect.SetRect(0,0,halfSourceWidth,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSourceWidth) - (sourceWidthModTwo),0,sourceWidth,halfSpriteHeight);
		toPoint.SetXY(spriteWidth - (halfSourceWidth) - (sourceWidthModTwo),0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(0,sourceHeight - (halfSpriteHeight) - (spriteHeightModTwo),halfSourceWidth,sourceHeight);
		toPoint.SetXY(0,halfSpriteHeight);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(sourceWidth - (halfSourceWidth) - (sourceWidthModTwo),sourceHeight - (halfSpriteHeight) - (spriteHeightModTwo),sourceWidth,sourceHeight);
		toPoint.SetXY(spriteWidth - (halfSourceWidth) - (sourceWidthModTwo),halfSpriteHeight);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		for(TInt j = 0; j < numOfVertAddedLines;j++)
			{
			fromRect.SetRect(spriteWidth - (halfSourceWidth) - (sourceWidthModTwo),0,spriteWidth - (halfSourceWidth) - (sourceWidthModTwo)+1,spriteHeight);
			toPoint.SetXY((halfSourceWidth)+j,0);
			iMainFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			iMaskFbsBitGc->BitBlt(toPoint,iTargetMaskBitmap,fromRect);
			}
		break;
		}
	case EHStretchVStretch:
		{
		const TInt halfSourceWidth = sourceWidth/2;
		const TInt halfSourceHeight = sourceHeight/2;
		const TInt sourceWidthModTwo = sourceWidth%2;
		const TInt sourceHeightModTwo = sourceHeight%2;
		fromRect.SetRect(0,0,halfSourceWidth,halfSourceHeight);
		iMaskFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		iMainFbsBitGc->BitBlt(posZeroZero,maskToUse,fromRect);
		fromRect.SetRect(0,halfSourceHeight,halfSourceWidth,sourceHeight);
		toPoint.SetXY(0,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo));
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		iMainFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(halfSourceWidth,0,sourceWidth,halfSourceHeight);
		toPoint.SetXY(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),0);
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		iMainFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		fromRect.SetRect(halfSourceWidth,halfSourceHeight,sourceWidth,sourceHeight);
		toPoint.SetXY(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),spriteHeight-(halfSourceHeight)-(sourceHeightModTwo));
		iMaskFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		iMainFbsBitGc->BitBlt(toPoint,maskToUse,fromRect);
		for(TInt h = 0; h < numOfVertAddedLines;h++)
			{
			fromRect.SetRect(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),0,spriteWidth-(halfSourceWidth)-(sourceWidthModTwo)+1,spriteHeight);
			toPoint.SetXY((halfSourceWidth)+h,0);
			iMainFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			iMaskFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			}
		for(TInt m = 0; m < numOfHorizAddedLines;m++)
			{
			fromRect.SetRect(0,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo),spriteWidth,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo)+1);
			toPoint.SetXY(0,(halfSourceHeight)+m);
			iMaskFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			}
		fromRect.SetRect(0,0,halfSourceWidth,halfSourceHeight);
		iMainFbsBitGc->BitBlt(posZeroZero,bitmapToUse,fromRect);
		fromRect.SetRect(0,halfSourceHeight,halfSourceWidth,sourceHeight);
		toPoint.SetXY(0,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo));
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		fromRect.SetRect(halfSourceWidth,0,sourceWidth,halfSourceHeight);
		toPoint.SetXY(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),0);
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		fromRect.SetRect(halfSourceWidth,halfSourceHeight,sourceWidth,sourceHeight);
		toPoint.SetXY(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),spriteHeight-(halfSourceHeight)-(sourceHeightModTwo));
		iMainFbsBitGc->BitBlt(toPoint,bitmapToUse,fromRect);
		for(TInt j = 0; j < numOfVertAddedLines;j++)
			{
			fromRect.SetRect(spriteWidth-(halfSourceWidth)-(sourceWidthModTwo),0,spriteWidth-(halfSourceWidth)-(sourceWidthModTwo)+1,spriteHeight);
			toPoint.SetXY((halfSourceWidth)+j,0);
			iMainFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			}
		for(TInt i = 0; i < numOfHorizAddedLines;i++)
			{
			fromRect.SetRect(0,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo),spriteWidth,spriteHeight-(halfSourceHeight)-(sourceHeightModTwo)+1);
			toPoint.SetXY(0,(halfSourceHeight)+i);
			iMainFbsBitGc->BitBlt(toPoint,iTargetBitmap,fromRect);
			}
		break;
		}
	default:
		Panic(EEgulPanicInvalidInternalSpriteResizeMode);
		break;
		}
	}