当前位置: 首页>>代码示例>>C++>>正文


C++ TPoint::SetXY方法代码示例

本文整理汇总了C++中TPoint::SetXY方法的典型用法代码示例。如果您正苦于以下问题:C++ TPoint::SetXY方法的具体用法?C++ TPoint::SetXY怎么用?C++ TPoint::SetXY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TPoint的用法示例。


在下文中一共展示了TPoint::SetXY方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PreTestSetupL

void CGdiPolygon::PreTestSetupL(const TRect &aRect, TInt )
	{
	iPnts.Reset();
	TPoint pnt;
	TInt maxPoints=Min((TInt)KMaxPolygonPoints,Min(aRect.Width(),aRect.Height())/KPolygonStep);
	TInt numPoints=0;
	if (maxPoints>0)
		{
		iPnts.AppendL(aRect.iTl);
		while(numPoints<maxPoints)
			{
			if (numPoints&1)
				pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
			else
				pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
			iPnts.AppendL(pnt);
			numPoints++;
			}
		pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
		iPnts.AppendL(pnt);
		while(numPoints>0)
			{
			numPoints--;
			if (numPoints&1)
				pnt.SetXY(aRect.iTl.iX+numPoints*KPolygonStep,aRect.iTl.iY+(numPoints+1)*KPolygonStep);
			else
				pnt.SetXY(aRect.iTl.iX+(numPoints+1)*KPolygonStep,aRect.iTl.iY+numPoints*KPolygonStep);
			iPnts.AppendL(pnt);
			}
		}
	}
开发者ID:kuailexs,项目名称:symbiandump-os1,代码行数:31,代码来源:TGDI.CPP

示例2: PictureUpdateL

void CRecognizerContainer::PictureUpdateL(
	CFbsBitmap& aBitmap, 
	RPointerArray<CCodeInfo>* aCodes, 
	const TPoint& aTranslation,
	TInt /*aMinDiffTranslation*/,
	TInt /*aRotation*/,
	TInt /*aMinDiffRotation*/)
{
	CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("PictureUpdateL"));

	iTranslation.SetXY(aTranslation.iX, aTranslation.iY);
	if (aCodes != NULL) {
		iCurrentCode = iVCS->FindClosestCode(iTarget);
		if (iCurrentCode >= 0) {
			CCodeInfo* ci = (*aCodes)[iCurrentCode];
			TPoint p = ci->GetTilting();
			iTilting.SetXY(p.iX, p.iY);

			if (ci->IsCodeValid()) {
				iInvalid=false;
				delete iCurrentCodeInfo; iCurrentCodeInfo=0;
				iCurrentCodeInfo=new (ELeave) CCodeInfo;
				iCurrentCodeInfo->ConstructL(*ci);
			} else {
				iInvalid=true;
			}
		}
	}

	iBitmap=&aBitmap;
	DrawImage(&aBitmap);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:32,代码来源:RecognizerView.cpp

示例3: StartDisplay

void CRecognizerContainer::StartDisplay()
{
	CALLSTACKITEM_N(_CL("CRecognizerContainer"), _CL("StartDisplay"));

	iTakingPicture = FALSE;
	iCurrentCode = -1;
	iBitmap = NULL;
	iTranslation.SetXY(0, 0);
	iTarget.SetXY(320, 240);
	iTilting.SetXY(0.0, 0.0);
	iMagnification = 2;

	iStandByLabel->MakeVisible(EFalse);

	ViewFinderStartStop();
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:16,代码来源:RecognizerView.cpp

示例4: SetGameState

void CAwardContainer::SetGameState()
{
    //iData->iGameState = TEnum::EControlMainMenu;
    //设置MainMenu下的对象初始状态 
    TRect iLeftTopRect = iData->ipBitMapPosition->GetPosition(TBitMapPosition::HighlightReturnEdge, 0);
    TPoint point;
    point.SetXY(FIRST_MENU_POSITION, FIRST_MENU_HEIGHT);
    point.iY = 610;
    iReturn.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontReturn, 0));
    iReturn.SetStartAndEndPoint(point, TPoint(270, point.iY));
    iReturn.SetHighLightRect(iLeftTopRect, TRect(180, 610 - 27, 359, 610 + 27));
    iReturn.ReSet();

    point.SetXY(180, 60);
    iNavAward.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontAward, 0));
    iNavAward.SetStartAndEndPoint(point, point);
    iNavAward.ReSet();
    iNavAward.UpdateObjectByCenter();
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:19,代码来源:AwardContainer.cpp

示例5: scroll

void WebScrollingDeceleratorGH::scroll()
{
    if (!m_decelelatorSwitch) return;
    // X = Vst*t - 0.5*a*(t * t)    
    TPoint dist;
    TReal32 intervalInSec = static_cast<TReal32>(KScrollIntervalTimeout) / 1000000;
    TReal32 t = (m_numscrollsteps++) * intervalInSec;
    TReal32 dx = 0.0;
    TReal32 dy = 0.0;
    TReal32 vx = 0.0;
    TReal32 vy = 0.0;
    TReal32 accelX = 0.0;
    TReal32 accelY = 0.0;
    
    if (m_initSpeed.iX) {
        accelX = (m_initSpeed.iX > 0) ?  KDecceleration : (-1) * KDecceleration;
        vx = m_initSpeed.iX + accelX * t;
        dx = m_initSpeed.iX * t + 0.5 * accelX * (t * t);
    }
        
    if (m_initSpeed.iY) {
        accelY = (m_initSpeed.iY > 0) ?  KDecceleration : (-1) * KDecceleration;
        vy = m_initSpeed.iY + accelY * t;
        dy = m_initSpeed.iY * t + 0.5 * accelY * (t * t);
    }
    
    dist.SetXY(static_cast<TInt>(dx), static_cast<TInt>(dy));
    
    WebFrameView* scrollingView = m_webView.pageScrollHandler()->currentScrollingFrameView();
    TPoint cpos = scrollingView->contentPos();
    dist = scrollingView->toDocCoords(dist);
    TPoint pos = m_startPos + dist;
   
    WebPageScrollHandler* handler = m_webView.pageScrollHandler();

    if ((vx * m_initSpeed.iX < 0) || (vy * m_initSpeed.iY < 0) || (vx + vy == 0) || 
        (m_numscrollsteps > 1 && !scrollingView->needScroll(pos) && 
        !handler->currentScrollingElement())) {
        if (m_scrollbarDrawer) {
            m_scrollbarDrawer->fadeScrollbar();
        }
        m_decelTimer->Cancel();
        handler->clearScrollingElement();
        m_webView.setViewIsScrolling(false);
        m_webView.toggleRepaintTimer(true);
    }
    else {
        TPoint scrollDelta = pos - m_lastPos;
        handler->scrollContent(scrollDelta);
        m_lastPos = pos;
    }  
}
开发者ID:gvsurenderreddy,项目名称:symbiandump-mw4,代码行数:52,代码来源:WebScrollingDeceleratorGH.cpp

示例6:

CGameSpriteFrame::CGameSpriteFrame(const TFileName& filename, TUint32 id, const CGameRect& r, CFbsBitmap* loader){

	loader->Load(filename, id, 0);
	
	TInt i,j;
	TInt h = loader->SizeInPixels().iHeight;
	TInt w = loader->SizeInPixels().iWidth;
	
	h = (h<r.h)?h:r.h;
	w = (w<r.w)?w:r.w;
	
	TInt H = minor2Pot(h);
	TInt W = minor2Pot(w);
	
	if(H>W)W=H;
	else H=W;
	
	this->texDim = H;
			 	    	    
	TRgb color;
	TPoint point;
	
	this->pixels = new TUint32[W*H];
		    	    
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
			point.SetXY(i,j);
			loader->GetPixel(color,point);
			this->pixels[i+j*W] = color.Value();
		}
	}
	
	glGenTextures(1, &(this->texId)); 

	glBindTexture(GL_TEXTURE_2D, this->texId);

	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);

	GLint format = GL_RGBA;

	glTexImage2D(GL_TEXTURE_2D, 0, format, W, H, 0,
	format, GL_UNSIGNED_BYTE, this->pixels);
	
}
开发者ID:Juanma-lach,项目名称:battletamagotchi,代码行数:44,代码来源:CGameSprite.cpp

示例7: DrawReturnArrow

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();
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:43,代码来源:Drawer.cpp

示例8: SetGameState

void CPausedContainer::SetGameState()
{
    //iData->iGameState = TEnum::EControlMainMenu;
    //设置MainMenu下的对象初始状态
    TRect iLeftTopRect = iData->ipBitMapPosition->GetPosition(TBitMapPosition::HighlightEdge, 0);
    TPoint point;
    point.SetXY(FIRST_MENU_POSITION, FIRST_MENU_HEIGHT);
    //1
    iResume.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontResume, 0));
    iResume.SetStartAndEndPoint(point, TPoint(180, point.iY));
    iResume.ReSet();
    iResume.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
    //2
    point.iX += MENU_WIGTH_SPAN;
    point.iY += MENU_HEIGHT_SPAN;
    iNewGame.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontNewGame, 0));
    iNewGame.SetStartAndEndPoint(point, TPoint(180, point.iY));
    iNewGame.ReSet();
    iNewGame.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
    //3
    point.iX += MENU_WIGTH_SPAN;
    point.iY += MENU_HEIGHT_SPAN;
    iOption.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontOption, 0));
    iOption.SetStartAndEndPoint(point, TPoint(180, point.iY));
    iOption.ReSet();
    iOption.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
    //4
    point.iX += MENU_WIGTH_SPAN;
    point.iY += MENU_HEIGHT_SPAN;
    iHelp.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontHelp, 0));
    iHelp.SetStartAndEndPoint(point, TPoint(180, point.iY));
    iHelp.ReSet();
    iHelp.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));
    //5
    point.iX += MENU_WIGTH_SPAN;
    point.iY += MENU_HEIGHT_SPAN;
    iReturn.SetBitMapRect(iData->ipBitMapPosition->GetPosition(TBitMapPosition::FontMainMenu, 0));
    iReturn.SetStartAndEndPoint(point, TPoint(180, point.iY));
    iReturn.ReSet();
    iReturn.SetHighLightRect(iLeftTopRect, TRect(0, point.iY - 27, SCREEN_WIDTH - 1, point.iY + 27));

}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:42,代码来源:PausedContainer.cpp

示例9: ConstructL

void CComponentControl::ConstructL(TInt aChildren, TInt aOwners, TPoint aPt, TSize aSize, TRgb aPenColor, TRgb aBrushColor, CGraphicsContext::TBrushStyle aBrushStyle)
    {
    	//Construct the base window of the control
    	CTestRectGc::ConstructL(aPt, aSize, aPenColor, aBrushColor, aBrushStyle);
    	InitComponentArrayL();

		TSize ChildSize(aSize.iWidth/2, aSize.iHeight/2);
		
		TPoint Offset;
		if (aOwners&1)
			Offset.SetXY(0,0);
		else
			Offset = aPt;
			
		CreateChildControlL(aChildren, aOwners>>1, Offset, ChildSize, aPenColor, aBrushColor, aBrushStyle);
		CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(ChildSize.iWidth, 0), ChildSize, aPenColor, aBrushColor, aBrushStyle);
		CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(0, ChildSize.iHeight), ChildSize, aPenColor, aBrushColor, aBrushStyle);
		CreateChildControlL(aChildren, aOwners>>1, Offset+TSize(ChildSize.iWidth, ChildSize.iHeight), ChildSize, aPenColor, aBrushColor, aBrushStyle);
		    		  		  	  		  	  	
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:20,代码来源:TConeInvalidate.cpp

示例10: GetPointFromConfig

TBool CDataWrapperBase::GetPointFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TPoint& aResult)
	{
	TBuf<KMaxTestExecuteCommandLength>	tempStore;

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

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

	if ( ret )
		{
		aResult.SetXY(x, y);
		}

	return ret;
	}
开发者ID:fedor4ever,项目名称:default,代码行数:22,代码来源:DataWrapperBase.cpp

示例11: GetMidPointofTop

//获得对象上面的边中点在屏幕上的位置
TPoint TWorldObject::GetMidPointofTop()
{
    TPoint point;
    point.SetXY(iCenter.iX, iWorldPosition.iTl.iY);
    return point;
}
开发者ID:jinhuafeng,项目名称:RS-MAN,代码行数:7,代码来源:WorldObject.cpp

示例12: RenderSprite

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);
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:101,代码来源:gulsprite.cpp


注:本文中的TPoint::SetXY方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。