本文整理汇总了C++中Paint函数的典型用法代码示例。如果您正苦于以下问题:C++ Paint函数的具体用法?C++ Paint怎么用?C++ Paint使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Paint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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();
}
示例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();
}
示例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);
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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);
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}