• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ Paint函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: WndProc

    LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
    {
        switch(nmsg) {
          case WM_PAINT:
            Paint();
            break;

          default:
            return super::WndProc(nmsg, wparam, lparam);
        }

        return 0;
    }
开发者ID:darkvaderXD2014,项目名称:reactos,代码行数:13,代码来源:explorer.cpp


示例2: pixmap

QPixmap CCJKShapeRect::Image( const QSize &size )
{
	QPixmap pixmap(size);
	pixmap.fill(Qt::transparent);
// 	pixmap.fill(Qt::white);
	QPainter painter(&pixmap);
	painter.setPen(QPen(Qt::black, 8));
	int width = qMax(10, size.width()-10);
	int height = qMax(10, size.height()-10);
	QRectF rect(5, 5, width, height);
	SetRect(rect);
	Paint(&painter);
	return pixmap;
}
开发者ID:kinglonglee,项目名称:graphics,代码行数:14,代码来源:cjkshaperect.cpp


示例3: Bitmap

void EditView::GenerateLarge()
{
  if ( m_pcSmallBitmap == NULL ) {
    return;
  }

  delete m_pcLargeBitmap;
  m_pcLargeBitmap = new Bitmap( 32, 32, CS_RGB32, Bitmap::SHARE_FRAMEBUFFER );
  
  Scale( m_pcSmallBitmap, m_pcLargeBitmap, m_nFilterType, 0.0f );
//  m_pcLargeIconView->SetBitmap( m_pcLargeBitmap );
  Paint( GetBounds() );
  Flush();
}
开发者ID:rickcaudill,项目名称:Pyro,代码行数:14,代码来源:editview.cpp


示例4: __

void RichText::Paint(Draw& w, int x, int y, int cx, const PaintInfo& pinit) const
{
	Mutex::Lock __(mutex);
	SimplePageDraw pw(w);
	PaintInfo pi(pinit);
	pi.top = PageY(0, 0);
	pi.bottom = PageY(0, INT_MAX);
	pi.usecache = true;
	pi.sizetracking = false;
	pi.highlight = Null;
	w.Offset(x, y);
	Paint(pw, Size(cx / pi.zoom, INT_MAX), pi);
	w.End();
}
开发者ID:koz4k,项目名称:soccer,代码行数:14,代码来源:TextPaint.cpp


示例5: PaintAll

void Pane::TunnelPaint(Surface* psurface, bool bPaintAll)
{
    if (m_pparent != NULL && !m_bOpaque) {
        psurface->Offset(-m_offset);
        m_pparent->TunnelPaint(psurface, false);    
        psurface->Offset(m_offset);
    }

    if (bPaintAll) {
        PaintAll(psurface);
    } else {
        Paint(psurface);
    }
}
开发者ID:BackTrak,项目名称:Allegiance-R4-Engine,代码行数:14,代码来源:pane.cpp


示例6: Paint

void MyFrame1::OnLeftUp(wxMouseEvent &event)
{
  //if (event.Moving())
  {
    wxCoord x, y;
    event.GetPosition(&x, &y);
    m_v2.x = (float)x;
    m_v2.y = (float)(m_panel1->GetSize().y - y);
    m_curPrimitive->AddVertex(m_v2);
    Controller::Get().AddPrimitive(m_curPrimitive);
    m_curPrimitive = NULL;
    Paint();
  }
}
开发者ID:sweetdark,项目名称:wxogl,代码行数:14,代码来源:myframe.cpp


示例7: BeginPaint

void
SWindow::WmPaint(Org_Mes* OrgMes)
{
	if(OrgMes->ExecMessage/* && (ControlMode == ControlMode_Normal)*/) {
		PAINTSTRUCT	ps;
		HDC		hdc = BeginPaint(&ps);

		Paint(hdc);

		EndPaint(&ps);
	}

	DefaultProc(OrgMes);
}
开发者ID:acook,项目名称:out_asio,代码行数:14,代码来源:Window.cpp


示例8: Paint

/// @brief Callback for the color picker dialog
/// @param col New color
void ColourButton::SetColour(agi::Color col) {
	colour = col;

	// Draw colour
	Paint();
	SetBitmapLabel(bmp);

	// Trigger a click event on this as some stuff relies on that to know
	// when the color has changed
	wxCommandEvent evt(wxEVT_COMMAND_BUTTON_CLICKED, GetId());
	evt.SetClientData(this);
	evt.SetEventObject(this);
	AddPendingEvent(evt);
}
开发者ID:Gpower2,项目名称:Aegisub,代码行数:16,代码来源:colour_button.cpp


示例9: saveRestore

void
gfxContext::FillWithOpacity(gfxFloat aOpacity)
{
  // This method exists in the hope that one day cairo gets a direct
  // API for this, and then we would change this method to use that
  // API instead.
  if (aOpacity != 1.0) {
    gfxContextAutoSaveRestore saveRestore(this);
    Clip();
    Paint(aOpacity);
  } else {
    Fill();
  }
}
开发者ID:typ4rk,项目名称:mozilla-history,代码行数:14,代码来源:gfxContext.cpp


示例10: strdup

/**
 * Load from file, and set the associated document file name
 *
 * @param file the file name
 * @param a ReturnExt
 */
ReturnExt EditorWindow::LoadFromFile(const char* file)
{
	ReturnExt r = editor->LoadFromFile(file);
	if (!r) return r;

	char* s = strdup(file);
	char* b = basename(s);
	SetTitle(b);
	free(s);

	Paint();
	
	return ReturnExt(true);
}
开发者ID:aific,项目名称:ape,代码行数:20,代码来源:EditorWindow.cpp


示例11: sweepPhase

//Cleans up the heap by adding free blocks to the freelist and changing header colors
void sweepPhase() {
  printf("sweeping ...\n");
  word* heapPtr = heap;
  //Go through the heap as long as the heap pointer is less than afterheap, which is a pointer to the last element in the heap
  while(heapPtr < afterHeap){
    int length = Length(heapPtr[0]);
    int len;
    switch(Color(heapPtr[0])){
      case Black: //If the header is black
        heapPtr[0] = Paint(heapPtr[0], White);
        break;
      case White: //If the header is white
        len = 0;
        /* Sums up the length of the adjacent free blocks */
        while((heapPtr+len) < afterHeap && Color(heapPtr[len])==White){
          len+=Length(heapPtr[len]) + 1; //Adds the length of the current block
        }
        //Make new header if any adjacent free blocks or else paint the existing header blue
        if(len>length){
          heapPtr[0] = mkheader(0, len-1, Blue);
        }else{
          heapPtr[0] = Paint(heapPtr[0],Blue);
        }
        //Set first element in the free block to point to freelist
        //and set freelist to point to the header of the free block
        heapPtr[1] = (word)freelist;
        freelist = &heapPtr[0];
        break;
    }
    //Set heap pointer to next block
    if(len>length){
      heapPtr += len;
    }else{
      heapPtr += length+1;
    }
  }
}
开发者ID:hyllekilde,项目名称:mier_mhyl_OO3,代码行数:38,代码来源:Exercise4.c


示例12: Load

/*
	Load()

	Carica l'immagine dal file nel controllo, creando l'oggetto immagine con la libreria specificata.
*/
BOOL CDibCtrl::Load(LPCSTR lpszFileName,LPCSTR lpcszLibraryName,BOOL bRebuildPalette/*=TRUE*/,BOOL bClearBeforeDraw/*=TRUE*/)
{
	CWaitCursor cursor;
	m_bValidDib = FALSE;

	// controlla che sia un file
	if(!(::GetFileAttributes(lpszFileName) & FILE_ATTRIBUTE_DIRECTORY))
	{
		// verifica se e' stata specificata una libreria differente
		if(m_szLibraryName[0]=='\0')
			strcpyn(m_szLibraryName,lpcszLibraryName,sizeof(m_szLibraryName));
		if(stricmp(m_szLibraryName,lpcszLibraryName)!=0)
		{
			m_ImageFactory.Delete();
			m_pImage = NULL;
			strcpyn(m_szLibraryName,lpcszLibraryName,sizeof(m_szLibraryName));
		}

		// crea l'oggetto immagine
		if(!m_pImage)
			m_pImage = m_ImageFactory.Create(m_szLibraryName,sizeof(m_szLibraryName));
		
		// carica l'immagine nel controllo
		if(m_pImage)
		{
			if(m_pImage->IsSupportedFormat(lpszFileName))
				if(m_pImage->Load(lpszFileName))
				{
					m_bValidDib = TRUE;

					// usa lo stesso oggetto per ogni immagine, per cui occhio con il parametro per ricalcolare la paletta
					m_ImageDraw.SetImage(m_pImage);
					
					if(bRebuildPalette)
					{
						m_ImageDraw.BuildLogPalette();
						RealizePalette(FALSE);
					}

					Paint(bClearBeforeDraw);
				}
		}
	}

	if(!m_bValidDib)
		Clear();

	return(m_bValidDib);
}
开发者ID:code4bones,项目名称:crawlpaper,代码行数:54,代码来源:CDibCtrl.cpp


示例13: _TERMINAL_Callback

static WM_RESULT _TERMINAL_Callback (/*const*/ WM_MESSAGE*pMsg) {
  TERMINAL_Handle hObj = pMsg->hWin;
  TERMINAL_Obj* pObj = TERMINAL_H2P(hObj);
  switch (pMsg->MsgId) {
  case WM_PAINT:
    GUI_DEBUG_LOG("BUTTON: _Callback(WM_PAINT)\n");
    Paint(pObj/*, (GUI_RECT*)pMsg->Data.p*/);
    return;
  case WM_DELETE:
    GUI_DEBUG_LOG("EDIT: _Callback(WM_DELETE)\n");
    Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  }
  WM_DefaultProc(pMsg);
}
开发者ID:byxob,项目名称:calendar,代码行数:15,代码来源:Terminal.c


示例14: GetDataNode

void mitk::GLMapper::MitkRender(mitk::BaseRenderer* renderer, mitk::VtkPropRenderer::RenderType  type )
{
  bool visible = true;

  GetDataNode()->GetVisibility(visible, renderer, "visible");

  if(!visible)
    return;

  // the if-condition ensures that Paint(renderer) is only called once, otherwise it will be called four times
  // it does not mean that OpenGL renders only an opaque scene
  if(type == mitk::VtkPropRenderer::Opaque)
    Paint(renderer);

}
开发者ID:151706061,项目名称:MITK,代码行数:15,代码来源:mitkGLMapper.cpp


示例15: clear_bitmap

void ZRadar::animate(Frame *space)
{
	STACKTRACE;

	//If the radar is disabled, don't do anything.
	if (active==FALSE) return;

	//Tell the frame to redraw this space
	space->add_box(0,0,Blank->w,Blank->h);

	//Copy the blank slate onto the temporary bitmap Painted
	if (Blank) blit(Blank, Painted, 0,0,0,0,Blank->w, Blank->h);
	else clear_bitmap(Painted);

	if (t!=NULL) {
		SpaceLocation *l = t->get_focus();
		Paint(Painted,l->pos);
		if (!t->exists()) t=NULL;
	}
	else        Paint(Painted, game->size/2.);

	//Copy Painted onto space->frame, which will then paint it on the screen.
	blit(Painted,space->surface,0,0,0,0,Blank->w,Blank->h);
}
开发者ID:Yurand,项目名称:tw-light,代码行数:24,代码来源:radar.cpp


示例16: Paint

void CTweakSystem::Fill(XMLScoreWrapper& Score, CLayout *Layout, int ActivePage, int ActiveSystem)
{
    m_Layout=Layout;
    m_ActivePage=ActivePage;
    m_ActiveSystem=ActiveSystem;
    ui->ScoreView->SetXML(Score);
    ui->ScoreView->setLocked(false);
    ui->ScoreView->setFollowResize(false);
    ui->ScoreView->setNavigationVisible(true);
    ui->ScoreView->setSize(Layout->Options.ScaleSize*2.0);
    Paint();
    ui->ScoreView->adjustSize();
    ui->FadingWidget->adjustSize();
    ui->FadingWidget->setFixedSize(ui->FadingWidget->size());
    FillVoicesCombo(ui->ScoreView->ActiveStaff());
}
开发者ID:vemod-,项目名称:ObjectComposerXML,代码行数:16,代码来源:ctweaksystem.cpp


示例17: main

int main(int argc, char **argv)
{
	if(SDL_Init(SDL_INIT_VIDEO) < 0)
		return 1;

	int videoflags = SDL_HWSURFACE | SDL_HWACCEL | SDL_FULLSCREEN | SDL_DOUBLEBUF;
	SDL_Surface * screen = OpenScreen(1024, 768, 32, videoflags);
	if(!screen)
		return 1;

	SDL_Event event;
	bool done = false;

	while(!done)
	{
		if(SDL_PollEvent(&event))
		{
			switch (event.type)
			{
				case SDL_KEYDOWN:
					if(event.key.keysym.sym == SDLK_LALT || event.key.keysym.sym == SDLK_TAB)
						break;
					if(event.key.keysym.sym == SDLK_RETURN)
					{
						videoflags ^= SDL_FULLSCREEN;
						screen = OpenScreen(screen->w, screen->h, screen->format->BitsPerPixel, videoflags);
						if(!screen)
							done = true;
						break;
					}
				case SDL_QUIT:
					done = true;
					break;
				default:
					break;
			}
		}
		else
		{
			Paint(screen);
			SDL_Flip(screen);
		}
	}
	SDL_FreeSurface(screen);
	SDL_Quit();
	return 0;
}
开发者ID:dreamsxin,项目名称:ultimatepp,代码行数:47,代码来源:sdlt1.cpp


示例18: switch

LRESULT MainWindow::WndProc( UINT iMessage, WPARAM wParam, LPARAM lParam )
{
    switch (iMessage)
    {
	case WM_CREATE:
	    break;
        case WM_PAINT:
            Paint();
            break;
        case WM_DESTROY:
            PostQuitMessage( 0 );
            break;
        default:
            return DefWindowProc( hWnd, iMessage, wParam, lParam );
    }
    return 0;
}
开发者ID:nicolaemariuta,项目名称:bachelorHomeworkAndStudy,代码行数:17,代码来源:DLLDEMO.CPP


示例19: switch

LRESULT ClockWindow::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
{
	switch(nmsg) {
	  case WM_PAINT:
		Paint();
		break;

	  case WM_LBUTTONDBLCLK:
		launch_cpanel(_hwnd, TEXT("timedate.cpl"));
		break;

	  default:
		return super::WndProc(nmsg, wparam, lparam);
	}

	return 0;
}
开发者ID:RareHare,项目名称:reactos,代码行数:17,代码来源:traynotify.cpp


示例20: blend

/**
 * This function is called when the Radar needs repainting.
 * @param canvas The canvas to paint on
 */
void
FlarmTrafficWindow::OnPaint(Canvas &canvas)
{
#ifdef ENABLE_OPENGL
  if (small) {
    const GLBlend blend(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

    canvas.SelectBlackPen();
    canvas.Select(Brush(look.background_color.WithAlpha(0xd0)));
    canvas.DrawCircle(radar_mid.x, radar_mid.y, radius);

  } else
#endif
    canvas.Clear(look.background_color);

  Paint(canvas);
}
开发者ID:MindMil,项目名称:XCSoar,代码行数:21,代码来源:FlarmTrafficWindow.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PaintRect函数代码示例发布时间:2022-05-30
下一篇:
C++ PageWriteback函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap