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


C++ EraseRect函数代码示例

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


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

示例1: ClearDownloadSettings

void
ClearDownloadSettings(void)
{
    GrafPtr oldPort;
    
    GetPort(&oldPort);
    if (gWPtr)
    {
        SetPort(gWPtr);
        
        if (gControls->tw->dlSettingsGB)
            DisposeControl(gControls->tw->dlSettingsGB);
            
    	if (gControls->tw->startMsg)
            EraseRect(&gControls->tw->startMsgBox);
            
    	if (gControls->tw->siteSelector)
    		DisposeControl(gControls->tw->siteSelector);	  
        if (gControls->tw->siteSelMsg)
            DisposeControl(gControls->tw->siteSelMsg);
                    	
        if (gControls->tw->saveBitsMsg)
            EraseRect(&gControls->tw->saveBitsMsgBox);
        if (gControls->tw->saveBitsCheckbox)
            DisposeControl(gControls->tw->saveBitsCheckbox);
            
        if (gControls->tw->proxySettingsBtn)
            DisposeControl(gControls->tw->proxySettingsBtn);
    }
    
    SetPort(oldPort);            
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:32,代码来源:TerminalWin.c

示例2: draw_window_contents

static void draw_window_contents(
	WindowPtr wp)
{
	GrafPtr old_port;

	GetPort(&old_port);
	SetPortWindowPort(wp);

	/* Any specific updating stuff.... */
	
#ifdef OP_PLATFORM_MAC_CARBON_FLAG
	{
		Rect	windowBounds;
		GetWindowPortBounds(wp, &windowBounds);
		EraseRect(&windowBounds);
	}
	#else
		EraseRect(&wp->portRect);
	#endif
	
	update_log(wp);

	SetPort(old_port);

	return;
}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:26,代码来源:shell.c

示例3: MCRegionCalculateMask

bool MCRegionCalculateMask(MCRegionRef self, int32_t w, int32_t h, MCBitmap*& r_mask)
{
	// Create a pixmap
	Pixmap t_image;
	t_image = MCscreen -> createpixmap(w, h, 1, False);
	
	// Draw into the pixmap's port
	CGrafPtr t_old_port;
	GDHandle t_old_device;
	GetGWorld(&t_old_port, &t_old_device);
	SetGWorld((CGrafPtr)t_image -> handle . pixmap, NULL);
	
	BackColor(whiteColor);
	ForeColor(blackColor);
	
	Rect t_rect;
	SetRect(&t_rect, 0, 0, w, h);
	EraseRect(&t_rect);
	
	PaintRgn((RgnHandle)self);
	
	SetGWorld(t_old_port, t_old_device);
	
	// Fetch the pixmap as a bitmap
	MCBitmap *t_bitmap;
	t_bitmap = MCscreen -> getimage(t_image, 0, 0, w, h, False);
	
	// Discard the pixmap
	MCscreen -> freepixmap(t_image);
	
	r_mask = t_bitmap;
	
	return true;
}
开发者ID:Bjoernke,项目名称:livecode,代码行数:34,代码来源:sysosxregion.cpp

示例4: DrawRect

//__________________________________________________________________
void		_HYGraphicPane::DrawInfoBox (_HYRect theBox, _String boxName)
{
	long   stringWidth, 
		   avWidth = theBox.right-theBox.left-20;
		   
	theBox.width = 1;
	
	DrawRect (theBox);
	if (boxName.sLength)
	{
		stringWidth = GetVisibleStringWidth (boxName, font);
		while (stringWidth>avWidth && boxName.sLength)
		{
			boxName.Trim (0, boxName.sLength-2);
			stringWidth = GetVisibleStringWidth (boxName, font);
		}
		// measure string length
		_HYRect		textRect = theBox;
		textRect.left += 8;
		textRect.right = textRect.left+stringWidth+4;
		textRect.top-=6;
		textRect.bottom = textRect.top+9;
		EraseRect   (textRect);
		DisplayText (boxName, textRect.bottom, textRect.left+2, true);
	}
}
开发者ID:mdsmith,项目名称:OCLHYPHY,代码行数:27,代码来源:HYGraphicPane.cpp

示例5: MyDrawString

void MyDrawString(/*short dir,*/ short h, short v, char *s,Boolean framed,short selectMode)
{
	Rect r;
	if(sharedPrinting)selectMode = POINTDRAWFLAG;
	if(strlen(s) >0)
	{
		GetTextOffsets(/*dir,*/s,&h,&v);
		GetStringRect(s,h,v,&r);
		if(selectMode == BADPOINTDRAWFLAG)selectMode = POINTDRAWFLAG;
		if(selectMode == POINTDRAWFLAG)
		{
			EraseRect(&r);
			MyMoveTo(h,v);
			drawstring(s);
		}
		if(framed)
		{		
			
			if(selectMode != POINTDRAWFLAG)
			{
				PenMode(patXor);PaintRect(&r);
			}
			PenMode(patCopy);
			MyFrameRect(&r);
		}
	}
}
开发者ID:JamesMakela-NOAA,项目名称:PyGnome,代码行数:27,代码来源:CONTDLG.cpp

示例6: QTApp_Draw

void QTApp_Draw (WindowReference theWindow)
{
	GrafPtr 					mySavedPort = NULL;
	GrafPtr 					myWindowPort = NULL;
	WindowPtr					myWindow = NULL;
	Rect						myRect;
	
	GetPort(&mySavedPort);
	
	myWindowPort = QTFrame_GetPortFromWindowReference(theWindow);
	myWindow = QTFrame_GetWindowFromWindowReference(theWindow);
	
	if (myWindowPort == NULL)
		return;
		
	MacSetPort(myWindowPort);
	
#if TARGET_API_MAC_CARBON
	GetPortBounds(myWindowPort, &myRect);
#else
	myRect = myWindowPort->portRect;
#endif

	BeginUpdate(myWindow);

	// erase any part of a movie window that hasn't already been updated
	// by the movie controller
	if (QTFrame_IsMovieWindow(theWindow))
		EraseRect(&myRect);

	// ***insert application-specific drawing here***
	
	EndUpdate(myWindow);
	MacSetPort(mySavedPort);
}
开发者ID:fruitsamples,项目名称:qtgraphics.win,代码行数:35,代码来源:ComApplication.c

示例7: ShowTxt

void
ShowTxt(void)
{	    
	switch (gCurrWin)
	{
		case kLicenseID:
			if(gControls->lw->licTxt)
			{
			    RGBColor backColorOld;
			    Rect     textRect;
			    
			    // get back color
			    GetBackColor(&backColorOld);
			    
			    // set to white
			    BackColor(whiteColor);
			    
			    // erase rect and update
			    textRect = (**(gControls->lw->licTxt)).viewRect;
			    EraseRect(&textRect);
				TEUpdate(&textRect, gControls->lw->licTxt);
				
				// restore back color
				RGBBackColor(&backColorOld);
			}
			break;
		default:
			break;
	}		
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:30,代码来源:LicenseWin.c

示例8: erase_window

// Erase a window interior
void erase_window(struct Window *window)
{
	EraseRect(window->RPort,
		window->BorderLeft,
		window->BorderTop,
		window->Width-window->BorderRight-1,
		window->Height-window->BorderBottom-1);
}
开发者ID:MrZammler,项目名称:opus_magellan,代码行数:9,代码来源:graphics.c

示例9: EraseRect

void Icon::Paint( const Rect &cUpdateRect )
{
	EraseRect( cUpdateRect );

	if( m_bSelected )
	{
		Rect cUpdateFrame = GetBounds();
		cUpdateFrame.top += 2;
		cUpdateFrame.left += 2;

		/* XXXKV: This is a hack; why is the height from GetBounds() so large? */
		cUpdateFrame.right = m_cSize.x - 2;
		cUpdateFrame.bottom = m_cSize.y - 2;

		FillRect( cUpdateFrame, m_sHighlightColor );

		/* Round edges */
		SetDrawingMode( DM_COPY );
		SetFgColor( m_sHighlightColor );

		DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.top - 2 ), 
					os::Point( cUpdateFrame.right - 2, cUpdateFrame.top - 2 ) );
		DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.top - 1 ), 
					os::Point( cUpdateFrame.right, cUpdateFrame.top - 1 ) );
			
		DrawLine( os::Point( cUpdateFrame.left - 2, cUpdateFrame.top + 2 ), 
					os::Point( cUpdateFrame.left - 2, cUpdateFrame.bottom - 2 ) );
		DrawLine( os::Point( cUpdateFrame.left - 1, cUpdateFrame.top ), 
					os::Point( cUpdateFrame.left - 1, cUpdateFrame.bottom ) );
								
		DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.bottom + 2 ), 
					os::Point( cUpdateFrame.right - 2, cUpdateFrame.bottom + 2 ) );
		DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.bottom + 1 ), 
					os::Point( cUpdateFrame.right, cUpdateFrame.bottom + 1 ) );
								
		DrawLine( os::Point( cUpdateFrame.right + 2, cUpdateFrame.top + 2 ), 
						os::Point( cUpdateFrame.right + 2, cUpdateFrame.bottom - 2 ) );
		DrawLine( os::Point( cUpdateFrame.right + 1, cUpdateFrame.top ), 
					os::Point( cUpdateFrame.right + 1, cUpdateFrame.bottom ) );

		SetFgColor( m_sFgColor );
	}

	SetDrawingMode( DM_BLEND );

	/* XXXKV: Will only work with BitmapImage; should use RTTI to find
	   type and handle accordingly */
	BitmapImage *pcImage = static_cast<BitmapImage*>( m_pcImage );
	Bitmap *pcBitmap = pcImage->LockBitmap();
	DrawBitmap( pcBitmap, pcImage->GetBounds(), m_cImageFrame );
	pcImage->UnlockBitmap();

	/* Draw the icon name */
	SetDrawingMode( DM_OVER );
	MovePenTo( m_cNamePos );
	DrawString( m_cName );
}
开发者ID:PyroOS,项目名称:Pyro,代码行数:57,代码来源:icon.cpp

示例10: UpdateAdditionsWin

void
UpdateAdditionsWin(void)
{
	Rect		r;
	Cell		c;
	int			i;
	GrafPtr		oldPort;
	GetPort(&oldPort);
	
	SetPort(gWPtr);
	
	MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad + 1);
	HLock(gControls->cfg->selAddMsg);
	DrawString( CToPascal(*gControls->cfg->selAddMsg));
	HUnlock(gControls->cfg->selAddMsg);
	
#if 0
	RGBColor backColorOld;
    Rect adjustedRect, *clRect = &gControls->aw->compListBox;
    SetRect(&adjustedRect, clRect->left, clRect->top+1, clRect->right, clRect->bottom-1);
    GetBackColor(&backColorOld);
    BackColor(whiteColor);
    EraseRect(&adjustedRect);
    RGBBackColor(&backColorOld);
#endif
   
	LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList);
	SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
	            gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
	FrameRect(&r);	
	
	SetPt(&c, 0, 0);
	if (LGetSelect(true, &c, gControls->aw->compList))
	{
		HLock((Handle)gControls->aw->compDescTxt);
		SetRect(&r, (*gControls->aw->compDescTxt)->viewRect.left,
					(*gControls->aw->compDescTxt)->viewRect.top,
					(*gControls->aw->compDescTxt)->viewRect.right,
					(*gControls->aw->compDescTxt)->viewRect.bottom);
		HUnlock((Handle)gControls->aw->compDescTxt);
		TEUpdate(&r, gControls->aw->compDescTxt);	
	}
	
	DrawDiskSpaceMsgs( gControls->opt->vRefNum );
	
	for (i = 0; i < numRows; i++)
	{
		if (gControls->cfg->comp[rowToComp[i]].highlighted)
		{
			AddInitRowHighlight(i);
			break;
		}
	}
	
	SetPort(oldPort);
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:56,代码来源:AdditionsWin.c

示例11: draw_device_area

static void draw_device_area(
	GDSpecPtr device_spec,
	GDHandle selected_device,
	Rect *frame)
{
	Point offset;
	GDHandle device;

	get_device_area_offset(frame, &offset);
	
	EraseRect(frame);
	FrameRect(frame);
	
	for (device= GetDeviceList(); device; device= GetNextDevice(device))
	{
		if (TestDeviceAttribute(device, screenDevice) && TestDeviceAttribute(device, screenActive))
		{
			GDSpec spec;
			Rect bounds;
			
			BuildExplicitGDSpec(&spec, device, device_spec->flags, device_spec->bit_depth, 0, 0);
			
			get_device_area_frame(device, &bounds, offset);
			
			RGBForeColor(HasDepthGDSpec(&spec) ? &rgb_dark_gray : &rgb_white);
			PaintRect(&bounds);
			RGBForeColor(&rgb_black);
			
			if (device==selected_device) PenSize(2, 2);
			FrameRect(&bounds);
			PenSize(1, 1);
			
			if (device==GetMainDevice())
			{
				bounds.bottom= bounds.top + DEVICE_AREA_MENU_BAR_HEIGHT;
				EraseRect(&bounds);
				FrameRect(&bounds);
			}
		}
	}
	
	return;
}
开发者ID:DrItanium,项目名称:moo,代码行数:43,代码来源:device_dialog.c

示例12: LCD_clear_area

void LCD_clear_area(Lcd *x)      /* erase the area occupied by the LCD */
{	
	Rect	r;
	
	r = x->lcd_oldRect;
	InsetRect(&r,1,1);
	EraseRect(&r);
	x->lcd_row = 0;
	x->lcd_col = 0;
}
开发者ID:CNMAT,项目名称:CNMAT-Externs,代码行数:10,代码来源:lcd.c

示例13: draw_scope

static void draw_scope(double *values)
{
    static int32 call_cnt;
    int offset, expose,i;
    RGBColor pixels[SCOPE_HEIGHT];
    double work[SCOPE_HEIGHT];
    int nze;
	Rect righthalf={0,SCOPE_WIDTH - SCROLL_THRESHOLD,
				SCOPE_HEIGHT, SCOPE_WIDTH },
		lefthalf={0,0,
				SCOPE_HEIGHT, SCOPE_WIDTH - SCROLL_THRESHOLD-1 };

	nze = 0;
    make_logspectrogram(values, work);
    if( win.show ){
		set_draw_pixel(work, pixels);

		expose = 0;

		SetPortWindowPort(win.ref);
		offset = call_cnt % SCROLL_THRESHOLD;
		if(offset == 0)
		{						//scroll the window
			EraseRect(&lefthalf);
			ScrollRect(&win.ref->portRect,
					-(SCOPE_WIDTH - SCROLL_THRESHOLD), 0, 0);
			EraseRect(&righthalf);
		}
			//draw
		for( i=0; i<SCOPE_HEIGHT; i++ ){
			RGBForeColor(&pixels[i]);
			MoveTo(SCOPE_WIDTH - SCROLL_THRESHOLD + offset,i);
			Line(0,0);
		}
	}
	if( skin_need_speana ){
		skin_draw_spectrum(work);
	    //ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "." );
	}
    if(nze)
	initialize_exp_hz_table(soundspec_zoom - 4 * nze);
    call_cnt++;
}
开发者ID:albertz,项目名称:timidity-macosx,代码行数:43,代码来源:mac_soundspec.c

示例14: MacClearViewPort

static void MacClearViewPort (void)
{
  Rect PlotRgnRect;

  PlotRgnRect.left        = currgw->Local_LL[0];
  PlotRgnRect.bottom      = currgw->Local_LL[1];
  PlotRgnRect.right       = currgw->Local_UR[0];
  PlotRgnRect.top         = currgw->Local_UR[1];

  EraseRect(&PlotRgnRect);
}
开发者ID:rolk,项目名称:ug,代码行数:11,代码来源:MacGraph.c

示例15: EraseRect

void
SimplePluginInstance::DoDraw(void)
{
    Rect drawRect;
    drawRect.top = 0;
    drawRect.left = 0;
    drawRect.bottom = drawRect.top + fWindow->height;
    drawRect.right = drawRect.left + fWindow->width;
    EraseRect( &drawRect );
    MoveTo( 2, 12 );
    DrawString("\pHello, World!");
}
开发者ID:binoc-software,项目名称:mozilla-cvs,代码行数:12,代码来源:npsimple.cpp


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