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

C++ PatBlt函数代码示例

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

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



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

示例1: BltCard

/*
 * internal
 */
static __inline VOID BltCard(HDC hdc, INT x, INT y, INT dx, INT dy, HDC hdcCard, DWORD dwRasterOp, BOOL bStretch)
{
	if (bStretch)
	{
		StretchBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, CARD_WIDTH, CARD_HEIGHT, dwRasterOp);
	} else
	{
		BitBlt(hdc, x, y, dx, dy, hdcCard, 0, 0, dwRasterOp);
/*
 * This is need when using Microsoft images, because they use two-color red/white images for
 * red cards and thus needs fix-up of the edge to black color.
 */
#if 0
		if (ISREDCARD(card))
		{
			PatBlt(hdc, x, y + 2, 1, dy - 4, BLACKNESS);
			PatBlt(hdc, x + dx - 1, y + 2, 1, dy - 4, BLACKNESS);
			PatBlt(hdc, x + 2, y, dx - 4, 1, BLACKNESS);
			PatBlt(hdc, x + 2, y + dy - 1, dx - 4, 1, BLACKNESS);
	   		SetPixel(hdc, x + 1, y + 1, 0);
	   		SetPixel(hdc, x + dx - 2, y + 1, 0);
   			SetPixel(hdc, x + 1, y + dy - 2, 0);
   			SetPixel(hdc, x + dx - 2, y + dy - 2, 0);
		}
#endif
	}
}
开发者ID:RareHare,项目名称:reactos,代码行数:30,代码来源:cards.c


示例2: GetWindowDC

//-----------------------------------------------------------------------------
// Name: HighlightWindow (from MSDN Spy Sample)
// Object: highlight or unhightlight a window
// Parameters : 
//     in : HWND hwnd : target window handle
//          BOOL fDraw : TRUE to draw, FALSE to clear
// Return : TRUE on success
//-----------------------------------------------------------------------------
void CSelectWindow::HighlightWindow( HWND hwnd, BOOL fDraw )
{
    #define DINV                3
    HDC hdc;
    RECT rc;
    BOOL bBorderOn;
    bBorderOn = fDraw;

    if (hwnd == NULL || !IsWindow(hwnd))
        return;

    hdc = GetWindowDC(hwnd);
    GetWindowRect(hwnd, &rc);
    OffsetRect(&rc, -rc.left, -rc.top);

    if (!IsRectEmpty(&rc))
    {
        PatBlt(hdc, rc.left, rc.top, rc.right - rc.left, DINV,  DSTINVERT);
        PatBlt(hdc, rc.left, rc.bottom - DINV, DINV,
            -(rc.bottom - rc.top - 2 * DINV), DSTINVERT);
        PatBlt(hdc, rc.right - DINV, rc.top + DINV, DINV,
            rc.bottom - rc.top - 2 * DINV, DSTINVERT);
        PatBlt(hdc, rc.right, rc.bottom - DINV, -(rc.right - rc.left),
            DINV, DSTINVERT);
    }

    ReleaseDC(hwnd, hdc);
}
开发者ID:340211173,项目名称:hf-2011,代码行数:36,代码来源:SelectWindow.cpp


示例3: RenderTrackingRect

// utility function that uses the PatBlt function to
// render a tracking rectangle
void RenderTrackingRect(IN HDC HDestDC, IN const RECT& RRender)
{
   const int width = RRender.right - RRender.left;
   const int height = RRender.bottom - RRender.top;
   const DWORD dwROP3 = DSTINVERT; // experiment with others

   // render top bar
   PatBlt(HDestDC,
          RRender.left, RRender.top,
          width, line_width,
          dwROP3);
   // render bottom bar
   PatBlt(HDestDC,
          RRender.left, RRender.bottom - line_width,
          width, line_width,
          dwROP3);
   // render left bar
   PatBlt(HDestDC,
          RRender.left, RRender.top + line_width,
          line_width, height - (2 * line_width),
          dwROP3);
   // render right bar
   PatBlt(HDestDC,
          RRender.right - line_width, RRender.top + line_width,
          line_width, height - (2 * line_width),
          dwROP3);

}
开发者ID:GYGit,项目名称:reactos,代码行数:30,代码来源:patblt.cpp


示例4: DrawUIBorder

void DrawUIBorder( LPRECT lprc )
{
    HDC hDC;
    int sbx, sby;
	
    hDC = CreateDC( "DISPLAY", NULL, NULL, NULL );
    SelectObject( hDC, GetStockObject( GRAY_BRUSH ) );
    sbx = GetSystemMetrics( SM_CXBORDER );
    sby = GetSystemMetrics( SM_CYBORDER );
    PatBlt( hDC, lprc->left, 
		lprc->top, 
		lprc->right - lprc->left-sbx, 
		sby, PATINVERT );
    PatBlt( hDC, lprc->right - sbx, 
		lprc->top, 
		sbx, 
		lprc->bottom - lprc->top-sby, PATINVERT );
    PatBlt( hDC, lprc->right, 
		lprc->bottom-sby, 
		-(lprc->right - lprc->left-sbx), 
		sby, PATINVERT );
    PatBlt( hDC, lprc->left, 
		lprc->bottom, 
		sbx, 
		-(lprc->bottom - lprc->top-sby), PATINVERT );
    DeleteDC( hDC );
}
开发者ID:zhiruiyan,项目名称:inputMethod,代码行数:27,代码来源:subs.c


示例5: Win32_AspectBlt

static void Win32_AspectBlt( HDC hdc, win32BackBuffer_t *buffer, int width, int height ) {
	if ( height == 0 ) {
		height = 1;
	}
	if ( width == 0 ) {
		width = 1;
	}
	float scale = 1.f;
	int scaledWidth = buffer->width;
	int scaledHeight = buffer->height;
	if ( width < height ) {
		scaledWidth = width;
		scale = ( ( ( float ) width / ( float ) buffer->width ) + 0.5f );
		scaledHeight = ( int ) ( ( scale * ( float ) buffer->height ) + 0.5f );
	} else {
		scaledHeight = height;
		scale = ( ( ( float ) height / ( float ) buffer->height ) + 0.5f );
		scaledWidth = ( int ) ( ( scale * ( float ) buffer->width ) + 0.5f );
	}
	int x = ( int ) ( ( ( width - scaledWidth ) / 2.f ) + 0.5f );
	int y = ( int ) ( ( ( height - scaledHeight ) / 2.f ) + 0.5f );
	PatBlt( hdc, 0, 0, width, height, WHITENESS );
	PatBlt( hdc, x, y, scaledWidth, scaledHeight, BLACKNESS );
	StretchDIBits( hdc,
		x, y, scaledWidth, scaledHeight,
		0, 0, buffer->width, buffer->height,
		buffer->memory, &buffer->bitmapInfo,
		DIB_RGB_COLORS, SRCCOPY );
	/*PatBlt( hdc, 0, 0, x, y, WHITENESS );
	PatBlt( hdc, x + scaledWidth, y + scaledHeight, width - x, height - y, WHITENESS );*/
}
开发者ID:ClaytronG,项目名称:tinyrenderer,代码行数:31,代码来源:win32_tiny.cpp


示例6: highlightWindowFrame

/*
 * highlightWindowFrame
 *
 * Highlight (or unhighlight) the specified
 * window handle's frame.
 */
static void
highlightWindowFrame(HWND hWnd)
{
  HDC     hdc;
  RECT    rc;

  if (!IsWindow(hWnd))
    return;

  hdc = GetWindowDC(hWnd);
  GetWindowRect(hWnd, &rc);
  OffsetRect(&rc, -rc.left, -rc.top);

  if (!IsRectEmpty(&rc)) {
    PatBlt(hdc, rc.left, rc.top, rc.right-rc.left, DINV, DSTINVERT);
    PatBlt(hdc, rc.left, rc.bottom-DINV, DINV, -(rc.bottom-rc.top-2*DINV),
	   DSTINVERT);
    PatBlt(hdc, rc.right-DINV, rc.top+DINV, DINV, rc.bottom-rc.top-2*DINV,
	   DSTINVERT);
    PatBlt(hdc, rc.right, rc.bottom-DINV, -(rc.right-rc.left), DINV,
	   DSTINVERT);
  }

  ReleaseDC(hWnd, hdc);
  UpdateWindow(hWnd);
}
开发者ID:AjayRamanathan,项目名称:gimp,代码行数:32,代码来源:winsnap.c


示例7: Win32DisplayBufferInWindow

INTERNAL_LINKAGE int 
Win32DisplayBufferInWindow(HDC deviceContext, Win32ScreenBuffer *screenBuffer, Win32WindowSize window_size)
{
    int result = 0;

    int offsetX = 10;
    int offsetY = 10;

#if 0
    // top
    PatBlt(deviceContext, 0, 0, window_size.width, offsetY, BLACKNESS);
    // left
    PatBlt(deviceContext, 0, 0, offsetX, window_size.height, BLACKNESS);
    // bottom
    PatBlt(deviceContext, 0, screenBuffer->height + offsetY, 
            windowSize.width, windowSize.height, BLACKNESS);
    // right
    PatBlt(deviceContext, screenBuffer->width + offsetX, 0, 
            windowSize.width, windowSize.height, BLACKNESS);

#endif
    result = StretchDIBits(deviceContext, 
                           0, 0, window_size.width, window_size.height,
                           0, 0, screenBuffer->width, screenBuffer->height, 
                           screenBuffer->memory,
                           (BITMAPINFO *)&screenBuffer->bitmapInfo, 
                           DIB_RGB_COLORS, SRCCOPY);

    return result;
}
开发者ID:superCleo,项目名称:QuakeZero,代码行数:30,代码来源:sys_win32.cpp


示例8: DisplayStreamInfos

void DisplayStreamInfos(HWND hW)
{
	HWND hWS=GetDlgItem(hW,IDC_SAREA);
	HDC hdc;RECT r;HBRUSH hBO;int ch,dy,i,j,id;
	
	//----------------------------------------------------//
	
	GetClientRect(hWS,&r);                                // get size of stream display
	hdc=GetDC(hWS);                                       // device context
	r.right--;                                            // leave the right border intact
	ScrollDC(hdc,-1,0,&r,&r,NULL,NULL);                   // scroll one pixel to the left
	
	//----------------------------------------------------//
	
	hBO = (HBRUSH) SelectObject(hdc,hBStream[0]);                    // clean the right border
	PatBlt(hdc,r.right-1,0,1,r.bottom,PATCOPY);
	
	//----------------------------------------------------//
	
	dy=r.bottom/MAXCHAN;                                  // size of one channel area
	
	for(ch=0;ch<MAXCHAN;ch++)                             // loop the channels
  {
		if(s_chan[ch].iIrqDone)
		{
			s_chan[ch].iIrqDone=0;
			PatBlt(hdc,r.right-1,ch*r.bottom/MAXCHAN,
				1,dy,BLACKNESS);
			continue;
    }
		
		
		if(s_chan[ch].bOn)                                  // channel is on?
    {
			j=s_chan[ch].sval;if(j<0)  j=-j;                  // -> get one channel data (-32k ... 32k)
			j=(dy*j)/32768;   if(j==0) j=1;                   // -> adjust to display coords
			i=(dy/2)+(ch*r.bottom/MAXCHAN)-j/2;               // -> position where to paint it
			
			
			
			if     (s_chan[ch].iMute)    id=1;                // -> get color id
			else if(s_chan[ch].bNoise)   id=2;
			else if(s_chan[ch].bFMod==2) id=3;
			else if(s_chan[ch].bFMod==1) id=4;
			else                         id=5;
			
			SelectObject(hdc,hBStream[id]);                   // -> select the brush
			PatBlt(hdc,r.right-1,i,1,j,PATCOPY);              // -> paint the value line
    }
		
		if(ch) SetPixel(hdc,r.right-1,                      // -> not first line?
			ch*r.bottom/MAXCHAN,RGB(0,0,0));    // --> draw the line (one dot scrolled to the left)
  }
	
	//----------------------------------------------------//
	
	SelectObject(hdc,hBO);                                // repair brush
	
	ReleaseDC(hWS,hdc);                                   // release context
}
开发者ID:Cancerous,项目名称:pcsxr-xenon,代码行数:60,代码来源:xr_debug.cpp


示例9: DrawRectangle

void DrawRectangle(HDC hdc, int x1, int y1, int x2, int y2)
{
    HGDIOBJ hOldBrush = ::SelectObject(hdc, ::GetSysColorBrush(COLOR_BTNSHADOW));
    PatBlt(hdc, x1, y1, x2 - x1, 1, PATCOPY);
    PatBlt(hdc, x1, y1, 1, y2 - y1, PATCOPY);
    PatBlt(hdc, x1, y2, x2 - x1, 1, PATCOPY);
    PatBlt(hdc, x2, y1, 1, y2 - y1 + 1, PATCOPY);
    ::SelectObject(hdc, hOldBrush);
}
开发者ID:fixelsan,项目名称:ukncbtl,代码行数:9,代码来源:DebugView.cpp


示例10: Win32TransferBufferToWindows

/**
 * Transfer our buffer into windows via StretchDIBits syscall.
 * @param *buffer A pointer to the buffer info struct. We use a pointer because
 *                it is a fairly big struct so that if the compiler doesn't inline
 *                the code, it would require a 'big' memory copy in the stack. So
 *                we send the pointer even though we do not modify the origin struct.
 */
internal void
Win32TransferBufferToWindows(HDC deviceContext,
                             win32_offscreen_buffer *buffer,
                             int windowWidth, int windowHeight)
{
  if((windowWidth >= 2 * buffer->width) &&
     (windowHeight >= 2 * buffer->height))
  {
    // If we can double stretch the buffer, we do it, because double-sampling
    // will not produce artifacts with StretchDIBits
    StretchDIBits(deviceContext,
                  /*
                  x, y, destWidth, destHeight,
                  x, y, originWidth, originHeight,
                  */
                  0, 0, 2 * buffer->width, 2 * buffer->height,
                  0, 0, buffer->width, buffer->height,
                  buffer->memory,
                  &buffer->info,
                  DIB_RGB_COLORS,
                  SRCCOPY);
  }
  else
  {
    int offsetX = 10;
    int offsetY = 10;

    // We have to clean the rectangles outside of our render target rectangle
    PatBlt(deviceContext, 0, 0, windowWidth, offsetY, BLACKNESS);
    PatBlt(deviceContext, 0, 0, offsetX, windowHeight, BLACKNESS);
    PatBlt(deviceContext, offsetX, offsetY + buffer->height,
                          windowWidth - offsetX, windowHeight - (offsetY + buffer->height),
                          BLACKNESS);
    PatBlt(deviceContext, offsetX + buffer->width, offsetY,
                          windowWidth - (offsetX + buffer->width), windowHeight - offsetY,
                          BLACKNESS);

    // NOTE(Cristián): For prototyping, we're are always going to blit 1-1 pixels
    // to make sure we don't introduce artifacts. This will change when the renderer
    // code is done.
    StretchDIBits(deviceContext,
                  /*
                  x, y, destWidth, destHeight,
                  x, y, originWidth, originHeight,
                  */
                  offsetX, offsetY, buffer->width, buffer->height,
                  0, 0, buffer->width, buffer->height,
                  buffer->memory,
                  &buffer->info,
                  DIB_RGB_COLORS,
                  SRCCOPY);
  }
}
开发者ID:cristiandonosoc,项目名称:handmade_hope,代码行数:60,代码来源:graphics_wrapper.cpp


示例11: TWnd_OnPaint

/*****************************************************************************
*
* TWnd_OnPaint
*
* Handle WM_PAINT message to time window.
*
* HWND hWnd                 - Window handle
*
* Repaint the 3D inset borders around the edge of the client area.
* Repaint the time.
*
*****************************************************************************/
VOID NEAR PASCAL TWnd_OnPaint( HWND hWnd) { PAINTSTRUCT ps; HDC hDC;
HBRUSH hBrOld; int nWidth; int nHeight;

    RECT                    rc;

    GetClientRect(hWnd, &rc);
    nWidth  = rc.right;
    nHeight = rc.bottom;
    
    hDC = BeginPaint(hWnd, &ps);

    hBrOld = (HBRUSH)SelectObject(hDC, GetStockObject(GRAY_BRUSH));
    PatBlt(hDC, 0, 0, 1, nHeight-1, PATCOPY);
    PatBlt(hDC, 1, 0, nWidth-2, 1, PATCOPY);

    SelectObject(hDC, GetStockObject(BLACK_BRUSH));
    PatBlt(hDC, 1, 1, 1, nHeight-3, PATCOPY);
    PatBlt(hDC, 2, 1, nWidth-4, 1, PATCOPY);

    SelectObject(hDC, GetStockObject(WHITE_BRUSH));
    PatBlt(hDC, rc.right-1, 0, 1, nHeight-1, PATCOPY);
    PatBlt(hDC, 0, rc.bottom-1, nWidth, 1, PATCOPY);

    SelectObject(hDC, GetStockObject(LTGRAY_BRUSH));
    PatBlt(hDC, rc.right-2, 1, 1, nHeight-2, PATCOPY);
    PatBlt(hDC, 1, rc.bottom-2, nWidth-2, 1, PATCOPY);
    
    SelectObject(hDC, hBrOld);

    gbRepaint = TRUE;
    PaintTime(hDC);

    EndPaint(hWnd, &ps);
}
开发者ID:AbdoSalem95,项目名称:WindowsSDK7-Samples,代码行数:46,代码来源:TIMEWND.c


示例12: DrawBox

/******************************************************************************
 * DrawBox(hDC, xChar, yChar, wChar, kChar, scale, htSep)
 *
 * purpose: draws the edit box for the character being edited and colors the
 *          grid squares according to the pixels set for the character.
 *
 * params:  HDC hDC         : handle to display context
 *          DWORD xChar      : x-location of char box.
 *          DWORD yChar      : y-location of char box
 *          DWORD wChar      : width of char box
 *          DWORD kChar      : height of char
 *          INT   wScale     : Scale of the squares.
 *          DWORD htSep      : height of square separators
 *
 * returns: none
 *
 * side effects:  alters matBox (global 2-d array with ready pixel info. on
 *                currently displayed box)
 *****************************************************************************/
VOID
DrawBox(
	HDC hDC,
	DWORD xChar,                             /* x-location of char. */
	DWORD yChar,                             /* y-location of char. */
	DWORD wChar,                             /* width of char. */
	DWORD kChar,                             /* height of char */
	INT   wScale,				 /* scale of the squares. */
	DWORD htSep                              /* hgt of square separators */
	)
/* draw a character of separate squares of height 'scale' with sep. 'htSep' */
{
	DWORD i, j, sep;

	if (fAll) {               /* redraw them all */
	    for (j = 0; j < kChar; j++) {
		sep = (j >= font.Ascent) ? htSep : 0;
		for (i = 0; i < wChar; i++) {
		    if (wScale == 1)
			SetPixel(hDC, xChar + i, yChar + j,
				matBox[i][j] == TRUE ? BLACK : WHITE);
		    else
			PatBlt(hDC,
				xChar + wScale * i,
				yChar + wScale * j + sep,
				wScale - htSep,
				wScale - htSep,
				colors[matBox[i][j] == TRUE ? 1 : 0]);
		}
	    }
	}
	else {			/* redraw one just flipped */
	    if (wScale == 1)
		SetPixel(hDC,
			xChar + ptC.x,
			yChar + ptC.y,
			matBox[ptC.x][ptC.y] == TRUE ? BLACK : WHITE);
	    else {
		sep = (((DWORD) ptC.y >= font.Ascent) ? htSep : 0L);
		SelectObject(hDC, hbrGray);
		PatBlt(hDC,
			xChar + wScale * ptC.x,
			yChar + wScale * ptC.y + sep,
			wScale - htSep,
			wScale - htSep,
			colors[matBox[ptC.x][ptC.y]]);
	    }
	}

}
开发者ID:mingpen,项目名称:OpenNT,代码行数:69,代码来源:fontchar.c


示例13: TreeListDrawSplitBar

VOID
TreeListDrawSplitBar(
	__in PTREELIST_OBJECT Object,
	__in LONG x,
	__in LONG y,
	__in BOOLEAN EndTrack
	)
{
    HDC hdc;
	RECT Rect;
	HBRUSH hBrushOld;

	hdc = GetDC(Object->hWnd);
	if (!hdc) {
        return;
	}

	GetClientRect(Object->hWnd, &Rect);
	hBrushOld = SelectObject(hdc, Object->hBrushBar);

    //
    // Clean the splibar we drew last time 
    //

	if (Object->SplitbarLeft > 0) {
		PatBlt(hdc, Object->SplitbarLeft, y, 
			   Object->SplitbarBorder, 
			   Rect.bottom - Rect.top - y, 
			   PATINVERT );
    }

    if (!EndTrack) {

        Rect.left += x;
		PatBlt(hdc, Rect.left, y, Object->SplitbarBorder, 
			   Rect.bottom - Rect.top - y, PATINVERT);

		Object->SplitbarLeft = Rect.left;

    }
    else {

		Object->SplitbarLeft = 0xffff8001;
    }

	SelectObject(hdc, hBrushOld);
	ReleaseDC(Object->hWnd, hdc);
}
开发者ID:HeckMina,项目名称:dprofiler,代码行数:48,代码来源:treelist.c


示例14: Shutdown

void Vid::SetMode( int ModeValue ) {
	if ( BackBuffer ) {
		Shutdown();
	}

	WindowWidth = ModeList[ModeValue].Width;
	WindowHeight = ModeList[ModeValue].Height;

	BufferHeight = WindowHeight;
	BufferWidth = WindowWidth;

	if ( ModeList[ModeValue].Type == ModeState::WINDOWED ) {
		SetWindowedMode( ModeValue );
	} else {
		SetFullscrenMode( ModeValue );
	}

	ShowWindow( MainWindow, SW_SHOWDEFAULT );

	HDC DeviceContext = GetDC( MainWindow );
	PatBlt( DeviceContext, 0, 0, BufferWidth, BufferHeight, BLACKNESS );
	ReleaseDC( MainWindow, DeviceContext );

	// define our bitmap info
	BitMapInfo.bmiHeader.biSize = sizeof( BitMapInfo.bmiHeader );
	BitMapInfo.bmiHeader.biWidth = BufferWidth;
	BitMapInfo.bmiHeader.biHeight = -BufferHeight;
	BitMapInfo.bmiHeader.biPlanes = 1;
	BitMapInfo.bmiHeader.biBitCount = 8 * BytesPerPixel;
	BitMapInfo.bmiHeader.biCompression = BI_RGB;

	BackBuffer = FrameBuffer( BufferWidth, BufferHeight, BytesPerPixel );
}
开发者ID:Caresilabs,项目名称:HandmadeQuakeCPP,代码行数:33,代码来源:VidWin.cpp


示例15: MainWindowCallback

LRESULT CALLBACK MainWindowCallback( HWND   Window,
                                     UINT   Message,
                                     WPARAM WParam,
                                     LPARAM LParam)
{
    LRESULT Result = 0;
    switch(Message){
        case WM_SIZE:
        {
            OutputDebugStringA("WN_SIZE \n" );
            
        }break;
        case WM_DESTROY:
        {
            OutputDebugStringA("WN_DESTROY \n" );
            

        }break;
        case WM_CLOSE:
        {
            OutputDebugStringA("WN_CLOSE \n" );

        }break;
        case WM_ACTIVATEAPP:
        {
            OutputDebugStringA("WM_ACTIVATEAPP \n" );
        }break;
        case WM_PAINT:
        {
            PAINTSTRUCT Paint;
            HDC DeviceContext =  BeginPaint(Window,&Paint );

            int X = Paint.rcPaint.left;
            int Y = Paint.rcPaint.top;
            int Height = Paint.rcPaint.bottom - Paint.rcPaint.top;
            int Width = Paint.rcPaint.right - Paint.rcPaint.left;
            static DWORD operation = WHITENESS;
            PatBlt(DeviceContext,X, Y, Width,Height, operation);
            if(operation == WHITENESS){
                operation  = BLACKNESS;
            }
            else{
                operation = WHITENESS;
            }

            EndPaint(Window, &Paint);
            
        }
        default:
        {
             //OutputDebugStringA("Default  \n" );
            Result = DefWindowProc(Window,Message,WParam,LParam); 
        }break;
        
    }


    return Result;
    
}
开发者ID:nuaro,项目名称:HandameCourse,代码行数:60,代码来源:win32_handmade.cpp


示例16: MyInvert

BOOL
MyInvert(
    IN PCONSOLE_INFORMATION Console,
    IN PSMALL_RECT SmallRect
    )

/*++

    invert a rect

--*/

{
    RECT Rect;

    Rect.left = SmallRect->Left-Console->CurrentScreenBuffer->Window.Left;
    Rect.top = SmallRect->Top-Console->CurrentScreenBuffer->Window.Top;
    Rect.right = SmallRect->Right+1-Console->CurrentScreenBuffer->Window.Left;
    Rect.bottom = SmallRect->Bottom+1-Console->CurrentScreenBuffer->Window.Top;
    if (Console->CurrentScreenBuffer->Flags & CONSOLE_TEXTMODE_BUFFER) {
        Rect.left *= Console->CurrentScreenBuffer->BufferInfo.TextInfo.FontSize.X;
        Rect.top *= Console->CurrentScreenBuffer->BufferInfo.TextInfo.FontSize.Y;
        Rect.right *= Console->CurrentScreenBuffer->BufferInfo.TextInfo.FontSize.X;
        Rect.bottom *= Console->CurrentScreenBuffer->BufferInfo.TextInfo.FontSize.Y;
    }
    PatBlt(Console->hDC,
              Rect.left,
              Rect.top,
              Rect.right  - Rect.left,
              Rect.bottom - Rect.top,
              DSTINVERT
             );

    return(TRUE);
}
开发者ID:mingpen,项目名称:OpenNT,代码行数:35,代码来源:clipbrd.c


示例17: CreateCompatibleBitmap

HBITMAP E_Util::ConvertIconToBitmap(HICON hIcon, int nWidth, int nHeight, COLORREF clrBackground)
{
	if (hIcon == NULL)
		return NULL;
	HDC hDC = NULL;
	HDC hMemDC = NULL;
	HBITMAP hBitmap = NULL;
	HBITMAP hOldBitmap = NULL;
	HBRUSH hBrush = NULL;
	HBRUSH hOldBrush = NULL;



	BOOL bGotBitmap = false;

	try {
		hDC = ::GetDC(NULL);
		if (hDC != NULL) {
			hBitmap = CreateCompatibleBitmap(hDC, nWidth, nHeight);
			if (hBitmap != NULL) {
				hMemDC = CreateCompatibleDC(hDC);
				if (hMemDC != NULL) {
					// Select the bitmap into the memory device context
					hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);

					hBrush = CreateSolidBrush(clrBackground);
					if (hBrush != NULL) {
						// Fill the bitmap with the background color
						hOldBrush = (HBRUSH)SelectObject(hMemDC, hBrush);
						PatBlt(hMemDC, 0, 0, nWidth, nHeight, PATCOPY);

						// Draw the icon
						DrawIconEx(hMemDC, 0, 0, hIcon, nWidth, nHeight, 0, NULL, DI_IMAGE);
						bGotBitmap = true;
					}
				}
			}
		}

		// Cleanup
		if (hOldBrush != NULL)
			SelectObject(hMemDC, hOldBrush);
		if (hOldBitmap != NULL)
			SelectObject(hMemDC, hOldBitmap);
		if (hBrush != NULL)
			DeleteObject(hBrush);
		if (hMemDC != NULL)
			DeleteDC(hMemDC);
		if (hDC != NULL)
			::ReleaseDC(NULL, hDC);

		if (!bGotBitmap && hBitmap != NULL) {
			DeleteObject(hBitmap);
			hBitmap = NULL;
		}
	}
	catch (...) {
	}
	return hBitmap;
}
开发者ID:jongheean11,项目名称:Expandable,代码行数:60,代码来源:E_Util.cpp


示例18: win_ddb_fill_rectangle

/* Fill a rectangle. */
static int
win_ddb_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
		       gx_color_index color)
{
    fit_fill(dev, x, y, w, h);
    /* Use PatBlt for filling.  Special-case black. */
    if (color == 0)
	PatBlt(wdev->hdcbit, x, y, w, h, rop_write_0s);
    else {
	select_brush((int)color);
	PatBlt(wdev->hdcbit, x, y, w, h, rop_write_pattern);
    }
    win_update((gx_device_win *) dev);

    return 0;
}
开发者ID:MasterPlexus,项目名称:vendor_goldenve,代码行数:17,代码来源:gdevwddb.c


示例19: DrawWndOnParentTransparent

void DrawWndOnParentTransparent(HWND hWnd, PAERO_SUBCLASS_WND_DATA pWndData)
{
    RECT rcWnd;
    VERIFY(GetWindowRect(hWnd, &rcWnd));
    HWND hParent = GetParent(hWnd);
    if(hParent)
    {
        ScreenToClient(hParent, &rcWnd);

        HDC hdc = GetDC(hParent);
        if(hdc)
        {
            BP_PAINTPARAMS params = { sizeof(BP_PAINTPARAMS) };
            params.dwFlags        = BPPF_ERASE;

            HDC hdcPaint = NULL;
            HPAINTBUFFER hBufferedPaint = NULL;
            hBufferedPaint = pWndData->m_pUxTheme->BeginBufferedPaint(hdc, &rcWnd, BPBF_TOPDOWNDIB, &params, &hdcPaint);
            if (hdcPaint)
            {
                VERIFY(PatBlt(hdcPaint, 0, 0, RECTWIDTH(rcWnd), RECTHEIGHT(rcWnd), BLACKNESS));
                VERIFY(S_OK==pWndData->m_pUxTheme->BufferedPaintSetAlpha(hBufferedPaint, &rcWnd, 0x00));
                VERIFY(S_OK==pWndData->m_pUxTheme->EndBufferedPaint(hBufferedPaint, TRUE));    
            }

            VERIFY(1==ReleaseDC(hParent, hdc));
        }
    }
}
开发者ID:sakbhav,项目名称:PassWd_Mgr,代码行数:29,代码来源:aerosubc.cpp


示例20: FillRect

/*
 * @implemented
 */
INT WINAPI
FillRect(HDC hDC, CONST RECT *lprc, HBRUSH hbr)
{
    BOOL Ret;
    HBRUSH prevhbr = NULL;

    /* Select brush if specified */
    if (hbr)
    {
        /* Handle system colors */
        if (hbr <= (HBRUSH)(COLOR_MENUBAR + 1))
            hbr = GetSysColorBrush(PtrToUlong(hbr) - 1);

        prevhbr = SelectObject(hDC, hbr);
        if (prevhbr == NULL)
            return (INT)FALSE;
    }

    Ret = PatBlt(hDC, lprc->left, lprc->top, lprc->right - lprc->left,
                 lprc->bottom - lprc->top, PATCOPY);

    /* Select old brush */
    if (prevhbr)
        SelectObject(hDC, prevhbr);

    return (INT)Ret;
}
开发者ID:RPG-7,项目名称:reactos,代码行数:30,代码来源:draw.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ Path函数代码示例发布时间:2022-05-30
下一篇:
C++ PasteboardSynchronize函数代码示例发布时间: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