您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ updateRect函数代码示例

51自学网 2021-06-03 09:14:16
  C++
这篇教程C++ updateRect函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中updateRect函数的典型用法代码示例。如果您正苦于以下问题:C++ updateRect函数的具体用法?C++ updateRect怎么用?C++ updateRect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

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

示例1: if

void COverlappedWindow::On_WM_KEYDOWN(WPARAM wParam, LPARAM lParam) {	int i_pressed_prev = i_pressed_;	int j_pressed_prev = j_pressed_;	if (is_digit_pressed_) {		if (wParam == VK_RIGHT) {			i_pressed_ = (i_pressed_ + 1) % 9;		} else if (wParam == VK_DOWN) {			j_pressed_ = (j_pressed_ + 1) % 9;		} else if (wParam == VK_LEFT) {			i_pressed_ = (i_pressed_ - 1 + 9) % 9;		} else if (wParam == VK_UP) {			j_pressed_ = (j_pressed_ - 1 + 9) % 9;		} else if (wParam == VK_DELETE || wParam == VK_BACK) {			grid[i_pressed_][j_pressed_] = 0;		} 		updateRect(field_rects_[i_pressed_prev][j_pressed_prev]);	} else if (wParam == VK_RIGHT || wParam == VK_DOWN || wParam == VK_LEFT || wParam == VK_UP) {		i_pressed_ = 0;		j_pressed_ = 0;		is_digit_pressed_ = true;	}	updateRect(field_rects_[i_pressed_][j_pressed_]);}
开发者ID:DeSerg,项目名称:mipt-solutions,代码行数:31,


示例2: SDL_LoadBMP

/** Loads sprite surface from image file@param img_fn Image filename */int EasyImageSprite::loadFromFile(char *img_fn){  SDL_Surface *temp;	/* Load the sprite image */	surface = SDL_LoadBMP(img_fn);	if ( surface == NULL ) {		fprintf(stderr, "Couldn't load %s: %s", img_fn, SDL_GetError());		return(-1);	}	  /* Set transparent pixel as the pixel at (0,0) */	SDL_SetColorKey(surface, (SDL_SRCCOLORKEY|SDL_RLEACCEL),						*(Uint32 *)surface->pixels);		/* Convert sprite to video format */	temp = SDL_DisplayFormat(surface);	SDL_FreeSurface(surface);	if ( temp == NULL ) {		fprintf(stderr, "Couldn't convert sprite: %s/n",							SDL_GetError());		return(-1);	}	surface = temp;	updateRect();	return 0;}
开发者ID:gefariasjr,项目名称:projetofinal1,代码行数:29,


示例3: r

void UserInterface::scrollbarChanged() {	Common::Rect r(73, 4, 73 + 9, 4 + 38);	_uiSlots.add(r);	_uiSlots.draw(false, false);	drawScroller();	updateRect(r);}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:7,


示例4: m_pSprite

Player::Player(Sprite* pSprite, float x, float y) : m_pSprite(pSprite), m_XPos(x), m_YPos(y){    updateRect();    m_WalkSpeed = 128.0f;    m_CurrAction = ActorActions::IDLE;}
开发者ID:zxRasp,项目名称:TileEngine,代码行数:7,


示例5: updateRect

bool MDragDownView::ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent){    if (isVisible() == false)    {        return false;    }        for (CCNode *c = this->m_pParent; c != NULL; c = c->getParent())    {        if (c->isVisible() == false)        {            return false;        }    }    updateRect();    m_touchBeginPosition = pTouch->getLocation();        if (m_viewRect.containsPoint(m_touchBeginPosition) == false)    {        return false;    }            if (m_eState != State::NONE)    {        return true;    }        m_isTouchDragBar = m_pDragBar ? m_dragBarRect.containsPoint(m_touchBeginPosition) : false;    m_viewOldSize = m_viewSize;        return true;}
开发者ID:xu561865,项目名称:demo_2,代码行数:34,


示例6: updateRect

void QgsRubberBand::reset( bool isPolygon ){  mPoints.clear();  mGeometryType = isPolygon ? QGis::Polygon : QGis::Line;  updateRect();  update();}
开发者ID:Ariki,项目名称:QGIS,代码行数:7,


示例7: MAX

void UserInterface::selectObject(int invIndex) {	if (_selectedInvIndex != invIndex || _inventoryChanged) {		int oldVocabCount = _selectedInvIndex < 0 ? 0 : _vm->_game->_objects.getItem(_selectedInvIndex)._vocabCount;		int newVocabCount = invIndex < 0 ? 0 : _vm->_game->_objects.getItem(invIndex)._vocabCount;		int maxVocab = MAX(oldVocabCount, newVocabCount);		updateSelection(CAT_INV_LIST, invIndex, &_selectedInvIndex);		_highlightedItemVocabIndex = -1;		_selectedItemVocabIdx = -1;		if (maxVocab) {			assert(_uiSlots.size() < 50);			int vocabHeight = maxVocab * 8;			Common::Rect bounds(240, 3, 240 + 80, 3 + vocabHeight);			_uiSlots.add(bounds);			_uiSlots.draw(false, false);			drawItemVocabList();			updateRect(bounds);		}	}	if (invIndex == -1) {		noInventoryAnim();	} else {		loadInventoryAnim(_vm->_game->_objects._inventoryList[invIndex]);		_vm->_palette->setPalette(&_vm->_palette->_mainPalette[7 * 3], 7, 1);		_vm->_palette->setPalette(&_vm->_palette->_mainPalette[246 * 3], 246, 2);	}}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:30,


示例8: removeFocus

void DOSBoxMenu::showMenu(bool show) {    if (menuVisible != show) {        menuVisible = show;        needRedraw = true;        removeFocus();        updateRect();    }}
开发者ID:joncampbell123,项目名称:dosbox-rewrite,代码行数:8,


示例9: setPosition

void GameObject::initialize(float centerX, float centerY, int width, int height, float angleD, float speed){	setPosition(centerX, centerY);	setAngleD(angleD);	setSpeed(speed);	setSize(width, height);	updateRect();}
开发者ID:wakeup5,项目名称:Terraria,代码行数:8,


示例10: update

void UBGraphicsCache::mouseMoveEvent(QGraphicsSceneMouseEvent *event){    mShapePos = event->pos();    // Note: if refresh issues occure, replace the following 3 lines by: update();    update(updateRect(event->pos()));    mOldShapeWidth = mShapeWidth;    mOldShapePos = event->pos();}
开发者ID:Ascaf0,项目名称:Sankore-3.1,代码行数:9,


示例11: connect

void WallpaperPreview::setWallpaper(Plasma::Wallpaper* wallpaper){    m_wallpaper = wallpaper;    if (m_wallpaper) {        connect(m_wallpaper, SIGNAL(update(QRectF)),                this, SLOT(updateRect(QRectF)));        resizeEvent(0);    }}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:9,


示例12: QgsMapCanvasItem

/*!  /class QgsHighlight  /brief The QgsHighlight class provides a transparent overlay widget  for highlightng features on the map.*/QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer )    : QgsMapCanvasItem( mapCanvas )    , mLayer( layer ){  mGeometry = geom ? new QgsGeometry( *geom ) : 0;  updateRect();  update();  setColor( QColor( Qt::lightGray ) );}
开发者ID:CzendaZdenda,项目名称:qgis,代码行数:14,


示例13: switch

void Player::update(size_t dt){    switch(m_CurrAction)    {        case ActorActions::IDLE:            // NOTHING TO DO            break;        case ActorActions::MOVE_LEFT:            m_XPos -= m_WalkSpeed * dt / 1000.0f;            updateRect();            break;        case ActorActions::MOVE_RIGHT:            m_XPos += m_WalkSpeed * dt / 1000.0f;            updateRect();            break;    }}
开发者ID:zxRasp,项目名称:TileEngine,代码行数:19,


示例14: setSpeedX

void GameObject::activate(){	setSpeedX(_speedX + (_accelX * TIMEMANAGER->getElapsedTime()));	setSpeedY(_speedY + (_accelY * TIMEMANAGER->getElapsedTime()));	_centerX += _speedX * TIMEMANAGER->getElapsedTime();	_centerY += _speedY * TIMEMANAGER->getElapsedTime();	updateRect();}
开发者ID:wakeup5,项目名称:Terraria,代码行数:10,


示例15: Q_UNUSED

void UBGraphicsCache::mouseReleaseEvent(QGraphicsSceneMouseEvent *event){    Q_UNUSED(event);    mDrawMask = false;    // Note: if refresh issues occure, replace the following 3 lines by: update();    update(updateRect(event->pos()));    mOldShapeWidth = mShapeWidth;    mOldShapePos = event->pos();}
开发者ID:Ascaf0,项目名称:Sankore-3.1,代码行数:10,


示例16: updateRect

void COverlappedWindow::On_WM_CHAR(WPARAM wParam, LPARAM lParam) {	if (is_digit_pressed_) {		if (wParam >= '0' && wParam <= '9') {			grid[i_pressed_][j_pressed_] = wParam - '0';		}	}	updateRect(field_rects_[i_pressed_][j_pressed_]);}
开发者ID:DeSerg,项目名称:mipt-solutions,代码行数:10,


示例17: updateRect

 void KeepAspectSkin::_setAlign(const MyGUI::IntSize& _oldsize) {     //mCurrentCoord.set(0, 0, mCroppedParent->getWidth(), mCroppedParent->getHeight());     if (mRectTexture.empty()) {         Base::_setAlign(_oldsize);         return;     }     float tw = mRectTexture.width();     float th = mRectTexture.height();     updateRect(tw,th); }
开发者ID:andryblack,项目名称:sandbox,代码行数:10,


示例18: QPointF

void LegendGroup::updateModel() {	QList<QGraphicsItem*> pool;	for (auto l : legends) { removeFromGroup(l); pool.append(l); }	for (auto t : texts) { removeFromGroup(t); pool.append(t); }	for (auto l : pool) delete l;	legends.clear();	texts.clear();	for (int i=0; i<model->rowCount(); i++) {		auto marker = model->at(i);		QString l = marker->label() + "/t:  " + QString::number(marker->count());		QColor color1 = marker->color1();		QColor color2 = marker->color2();		int type = marker->activeType();		if (0 == type) {			QRectF r = MarkerItem::rectFromClick(origin + QPointF(0, (mySize*2 + myPenWidth + 10) * (i+1)), mySize);			QLineF l(r.topLeft(), r.bottomRight());			auto marker = new ArrowItem(l);			marker->setArrowhead(ArrowHead::Start);			marker->setColor1(color1);			marker->setColor2(color2);			marker->setPenWidth(myPenWidth);			legends.append(marker);			addToGroup(marker);		}		else if (1 == type) {			auto marker = new RectItem(MarkerItem::rectFromClick(origin + QPointF(0, (mySize*2 + myPenWidth + 10) * (i+1)), mySize));			marker->setColor1(color1);			marker->setColor2(color2);			marker->setPenWidth(myPenWidth);			legends.append(marker);			addToGroup(marker);		}		else {			auto marker = new EllipseItem(MarkerItem::rectFromClick(origin + QPointF(0, (mySize*2 + myPenWidth + 10) * (i+1)), mySize));			marker->setColor1(color1);			marker->setColor2(color2);			marker->setPenWidth(myPenWidth);			legends.append(marker);			addToGroup(marker);		}		auto label = new RichTextItem(l);		label->setFont(myFont);		label->setFontSize(myFontSize);		label->setKeyPressFunc([this](QKeyEvent* event) { updateRect(); });		label->setTextInteractionFlags(Qt::TextEditorInteraction);		label->setFlag(QGraphicsItem::ItemIsFocusable);		QPointF textPos = legends.at(i)->boundingRect().center() + 			QPointF(legends.at(i)->boundingRect().width()/2+20, -label->boundingRect().height()*0.5);		label->setPos(textPos);		label->setZValue(1000);		texts.append(label);		addToGroup(label);	}	calculatePos();}
开发者ID:lebenasa,项目名称:ImageRasterReboot,代码行数:55,


示例19: updateRect

voidDisplayDevice_Haiku::update(const PPRect&r){	// Translate coordinates: tracker -> view	BRect updateRect(r.x1, r.y1, r.x2, r.y2);	updateRect.OffsetBy(fMilkyView->TopLeft());	fDirtyRegion->Include(updateRect);	release_sem(fBitmapLock);	acquire_sem(fBitmapLock);}
开发者ID:Fatbag,项目名称:MilkyTracker,代码行数:11,


示例20: GET_X_LPARAM

void COverlappedWindow::On_LButtonDown(WPARAM wParam, LPARAM lParam) {	int x = GET_X_LPARAM(lParam);	int y = GET_Y_LPARAM(lParam);	if (wParam == MK_LBUTTON) {		for (int i = 0; i <= 10; ++i) {			if (x >= menu_rects_[i].left && x <= menu_rects_[i].right &&				y >= menu_rects_[i].top && y <= menu_rects_[i].bottom) {				if (i == 10) {					menu_buttons_[10] = menu_button_pressed_BMP_;				} else {					menu_buttons_[i] = menu_digits_pressed_[i];				}				updateRect(menu_rects_[i]);			}		}		for (int i = 0; i < 9; ++i) {			for (int j = 0; j < 9; ++j) {				if (x >= i * cell_size_ && x <= (i + 1) * cell_size_ &&					y >= j * cell_size_ && y <= (j + 1) * cell_size_) {					if (is_digit_pressed_) {						updateRect(field_rects_[i_pressed_][j_pressed_]);					}					is_digit_pressed_ = true;					i_pressed_ = i;					j_pressed_ = j;					updateRect(field_rects_[i][j]);				}			}		}	}	//InvalidateRect(handle, NULL, TRUE);}
开发者ID:DeSerg,项目名称:mipt-solutions,代码行数:41,


示例21: initImage

void KisTransparencyMaskTest::testMoveMaskItself(){    KisImageSP image;    KisPaintLayerSP layer;    KisPaintDeviceSP dev;    KisTransparencyMaskSP mask;    initImage(image, layer, dev, mask);    mask->initSelection(layer);    mask->selection()->pixelSelection()->invert();    mask->select(QRect(50, 50, 100, 100));    KisFullRefreshWalker walker(image->bounds());    KisAsyncMerger merger;    walker.collectRects(layer, image->bounds());    merger.startMerge(walker);    // image->projection()->convertToQImage(0, 0,0,300,300).save("proj_before.png");    QRect initialRect(0,0,200,100);    QCOMPARE(layer->exactBounds(), initialRect);    QCOMPARE(image->projection()->exactBounds(), QRect(50,50,100,50));    //layer->setX(100);    //layer->setY(100);    dbgKrita << "Sel. rect before:" << mask->selection()->selectedExactRect();    mask->setX(50);    mask->setY(25);    dbgKrita << "Sel. rect after:" << mask->selection()->selectedExactRect();    QCOMPARE(mask->selection()->selectedExactRect(), QRect(100, 75, 100, 100));    QCOMPARE(layer->paintDevice()->exactBounds(), initialRect);    QCOMPARE(layer->projection()->exactBounds(), QRect(50, 50, 100, 50));    dbgKrita << "";    QRect updateRect(0,0,300,300);    walker.collectRects(mask, updateRect);    merger.startMerge(walker);    // image->projection()->convertToQImage(0, 0,0,300,300).save("proj_after.png");    QCOMPARE(layer->paintDevice()->exactBounds(), initialRect);    QCOMPARE(layer->projection()->exactBounds(), QRect(100, 75, 100, 25));}
开发者ID:ChrisJong,项目名称:krita,代码行数:52,


示例22: updateRect

void DOSBoxMenu::setScale(size_t s) {    if (s == 0) s = 1;    if (s > 2) s = 2;    if (fontCharScale != s) {        fontCharScale = s;        menuBarHeight = menuBarHeightBase * fontCharScale;        fontCharWidth = fontCharWidthBase * fontCharScale;        fontCharHeight = fontCharHeightBase * fontCharScale;        updateRect();        layoutMenu();    }}
开发者ID:joncampbell123,项目名称:dosbox-rewrite,代码行数:13,


示例23: drawInventoryList

void UserInterface::updateSelection(ScrCategory category, int newIndex, int *idx) {	Game &game = *_vm->_game;	Common::Array<int> &invList = game._objects._inventoryList;	Common::Rect bounds;	if (category == CAT_INV_LIST && _inventoryChanged) {		*idx = newIndex;		bounds = Common::Rect(90, 3, 90 + 69, 3 + 40);		_uiSlots.add(bounds);		_uiSlots.draw(false, false);		drawInventoryList();		updateRect(bounds);		_inventoryChanged = false;		if (invList.size() < 2) {			_scrollbarElevator = 0;		} else {			int v = _inventoryTopIndex * 18 / (invList.size() - 1);			_scrollbarElevator = MIN(v, 17);		}	} else {		int oldIndex = *idx;		*idx = newIndex;		if (oldIndex >= 0) {			writeVocab(category, oldIndex);			if (getBounds(category, oldIndex, bounds))				updateRect(bounds);		}		if (newIndex >= 0) {			writeVocab(category, newIndex);			if (getBounds(category, newIndex, bounds))				updateRect(bounds);		}	}}
开发者ID:CobaltBlues,项目名称:scummvm,代码行数:39,


示例24: DialogBox

void COverlappedWindow::On_LButtonUp(WPARAM wParam, LPARAM lParam) {	if (menu_buttons_[10] == menu_button_pressed_BMP_) {		int action = DialogBox(GetModuleHandle(0), MAKEINTRESOURCE(IDD_MENU_DIALOG), handle, reinterpret_cast<DLGPROC>(DialogProc));		switch (action) {		case START:			sudoku.getRandomGrid(grid);			InvalidateRect(handle, NULL, TRUE);			break;		case RESTART:			sudoku.getPreviousGrid(grid);			InvalidateRect(handle, NULL, TRUE);			break;		case DEV:			MessageBox(handle, L"The game is created by Serg Popov", L"Developers", MB_OK);			break;		default:			break;		}		menu_buttons_[10] = menu_button_BMP_;		updateRect(menu_rects_[10]);	}	for (int i = 0; i <= 9; ++i) {		if (menu_buttons_[i] == menu_digits_pressed_[i] && is_digit_pressed_) {			//is_digit_pressed_ = false;			grid[i_pressed_][j_pressed_] = i;		}		menu_buttons_[i] = menu_digits_[i];		updateRect(menu_rects_[i]);		updateRect(field_rects_[i_pressed_][j_pressed_]);	}}
开发者ID:DeSerg,项目名称:mipt-solutions,代码行数:38,


示例25: QgsMapCanvasItem

/*!  /class QgsHighlight  /brief The QgsHighlight class provides a transparent overlay widget  for highlightng features on the map.*/QgsHighlight::QgsHighlight( QgsMapCanvas* mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer )    : QgsMapCanvasItem( mapCanvas )    , mLayer( layer ){  mGeometry = geom ? new QgsGeometry( *geom ) : 0;  if ( mapCanvas->mapRenderer()->hasCrsTransformEnabled() )  {    QgsCoordinateTransform transform( mLayer->crs(), mapCanvas->mapRenderer()->destinationCrs() );    mGeometry->transform( transform );  }  updateRect();  update();  setColor( QColor( Qt::lightGray ) );}
开发者ID:coyotte508,项目名称:Quantum-GIS,代码行数:19,


示例26: updateRect

void QgsHighlight::init(){  if ( mMapCanvas->mapRenderer()->hasCrsTransformEnabled() )  {    const QgsCoordinateTransform* ct = mMapCanvas->mapRenderer()->transformation( mLayer );    if ( ct )    {      mGeometry->transform( *ct );    }  }  updateRect();  update();  setColor( QColor( Qt::lightGray ) );}
开发者ID:ColeCummins,项目名称:QGIS,代码行数:14,



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


C++ updateRelativeLengthsInformation函数代码示例
C++ updateProjectionMatrix函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。