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

C++ GdiFlush函数代码示例

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

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



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

示例1: PaintWindowThread

static void PaintWindowThread(void *)
{
	/* First tell the main thread we're started */
	_draw_mutex->BeginCritical();
	SetEvent(_draw_thread_initialized);

	/* Now wait for the first thing to draw! */
	_draw_mutex->WaitForSignal();

	while (_draw_continue) {
		/* Convert update region from logical to device coordinates. */
		POINT pt = {0, 0};
		ClientToScreen(_wnd.main_wnd, &pt);
		OffsetRect(&_wnd.update_rect, pt.x, pt.y);

		/* Create a device context that is clipped to the region we need to draw.
		 * GetDCEx 'consumes' the update region, so we may not destroy it ourself. */
		HRGN rgn = CreateRectRgnIndirect(&_wnd.update_rect);
		HDC dc = GetDCEx(_wnd.main_wnd, rgn, DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_INTERSECTRGN);

		PaintWindow(dc);

		/* Clear update rect. */
		SetRectEmpty(&_wnd.update_rect);
		ReleaseDC(_wnd.main_wnd, dc);

		/* Flush GDI buffer to ensure drawing here doesn't conflict with any GDI usage in the main WndProc. */
		GdiFlush();

		_draw_mutex->WaitForSignal();
	}

	_draw_mutex->EndCritical();
	_draw_thread->Exit();
}
开发者ID:ivansams,项目名称:OpenTTD,代码行数:35,代码来源:win32_v.cpp


示例2: InterfaceDrawElements

/*
 * InterfaceDrawElements:  Draw spiffy interface elements.
 */
void InterfaceDrawElements(HDC hdc)
{
  int i, x, y;
  InterfaceElement *e;
  Bool vertical;

  for (i=0; i < NUM_AUTO_ELEMENTS; i++)
  {
	  //	Temp. disable xxx
/*	  if( i >= ELEMENT_ULTOP && i <= ELEMENT_LRRIGHT )
		  continue;
	  if( i >= ELEMENT_IULTOP && i <= ELEMENT_ILRRIGHT )
		  continue;
	  if( i == ELEMENT_BLLBOTTOM || i == ELEMENT_BLRBOTTOM )
		  continue;*/

    OffscreenWindowBackground(NULL, elements[i].x, elements[i].y, elements[i].width, elements[i].height);
    
    OffscreenBitBlt(hdc, elements[i].x, elements[i].y, elements[i].width, elements[i].height,
		    elements[i].bits, 0, 0, DIBWIDTH(elements[i].width), 
		    OBB_COPY | OBB_FLIP | OBB_TRANSPARENT);
    GdiFlush();
  }

  for (i=0; i < NUM_AUTO_REPEATERS; i++)
  {
	  //	Temp. disable xxx
	if( i >= ELEMENT_ITOP && i <= ELEMENT_IRIGHT )
		continue;
	  //	disable xxx
	if( i >= ELEMENT_TOP && i <= ELEMENT_RIGHT )
		continue;
	if( i == ELEMENT_BBOTTOM )
		continue;

	e = &repeaters[i].element;
    x = e->x;
    y = e->y;
    vertical = repeaters[i].vertical;
        
    while (1)
    {
      if ((vertical && y > repeaters[i].end) || (!vertical && x > repeaters[i].end))
	break;
      
      OffscreenWindowBackground(NULL, x, y, e->width, e->height);
      OffscreenBitBlt(hdc, x, y, e->width, e->height, e->bits, 0, 0, DIBWIDTH(e->width), 
		      OBB_COPY | OBB_FLIP | OBB_TRANSPARENT);
      if (vertical)
	y += e->height;
      else x += e->width;

      GdiFlush();
    }
  }
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:59,代码来源:drawint.c


示例3: AmbireCaptureCapture

FREObject __cdecl AmbireCaptureCapture(FREContext ctx, void * functionData, uint32_t argc, FREObject argv[]) {
	bool success = false;
	POINT pt = { 0 };
	FREBitmapData bd = { 0 };
	FREResult result = FREAcquireBitmapData(argv[0], &bd);
	if(result == FRE_OK) {
		int width = bd.width;
		int height = bd.height;
		BITMAPINFOHEADER bmi = { 0 };
		bmi.biSize = sizeof(bmi);
		bmi.biWidth = width;
		bmi.biHeight = height;
		bmi.biPlanes = 1;
		bmi.biBitCount = 24;
		int stride = ((width * 3 + 3) / 4) * 4;
		bmi.biSizeImage = stride * height;
		void * ppvBits = 0;
		HDC hdcDesktop = GetDC(0);
		if(hdcDesktop) {
			HDC hdcMem = CreateCompatibleDC(hdcDesktop);
			if(hdcMem) {
				HBITMAP hbm = CreateDIBSection(hdcMem, (const BITMAPINFO *)&bmi, 0, &ppvBits, 0, 0);
				if(hbm) {
					SelectObject(hdcMem, hbm);
					BitBlt(hdcMem, 0, 0, width, height, hdcDesktop, 0, 0, SRCCOPY);
					GdiFlush();
					ReleaseDC(0, hdcDesktop);
					DeleteDC(hdcMem);
					GdiFlush();
					for(int y = 0; y < height; ++y) {
						const unsigned char * p = reinterpret_cast<unsigned char *>(ppvBits) + y * stride;
						uint32_t * q = reinterpret_cast<uint32_t *>(bd.bits32) + y * bd.lineStride32;
						for(int x = 0; x < width; ++x, p += 3, ++q) {
							*q = 0xFF000000 | (p[2] << 16) | (p[1] << 8) | p[0];
						}
					}
					success = true;
					DeleteObject(hbm);
				} else {
					DeleteDC(hdcMem);
				}
			} else {
				ReleaseDC(0, hdcDesktop);
			}
		}
		FREReleaseBitmapData(argv[0]);
	}
	FREObject rv = 0;
	FRENewObjectFromBool(success ? 1 : 0, &rv);
	return rv;
}
开发者ID:michaelboyle-smarttech,项目名称:itec-ambire,代码行数:51,代码来源:AmbireCapture-Windows-x86.cpp


示例4: text_bitmap

      // Draw text to full-screen sized bitmap, cleared to <bgcolor>
      // Draw boxes for each word on EyeLink tracker display if <dotrack> set
      // Use font selected with get_new_font(), and draws it in <fgcolor>
      // RECT <margins> sets margins, and <lspace> sets pixels between lines
HBITMAP text_bitmap(char *txt, COLORREF fgcolor, COLORREF bgcolor, 
                               RECT margins, int lspace, int dotrack)
{
  HDC hdc;
  HBITMAP hbm;
  HDC mdc;
  HBRUSH oBrush;
  HBITMAP obm;

  hdc = GetDC(NULL);                 
  mdc = CreateCompatibleDC(hdc);     // create display-compatible memory context
  hbm = CreateCompatibleBitmap(hdc, SCRWIDTH, SCRHEIGHT);
  obm = SelectObject(mdc, hbm);      // create DDB bitmap, select into context
                                     
  oBrush = SelectObject(mdc, CreateSolidBrush(bgcolor | 0x02000000L));  // brush to fill with 
  PatBlt(mdc, 0, 0, SCRWIDTH, SCRHEIGHT, PATCOPY);                      // CLEAR BITMAP
  DeleteObject(SelectObject(mdc, oBrush));

  draw_text_box(mdc, txt, fgcolor, margins, lspace, dotrack);  // DRAW THE TEXT

  GdiFlush();     // ADDED for Wimdows 2000/XP: Forces drawing to be immediate      

  SelectBitmap(mdc, obm);     // Release the GDI resources
  DeleteDC(mdc);
  ReleaseDC(NULL, hdc);
  return hbm;                 // Return the new bitmap
}
开发者ID:SnubbleJr,项目名称:DiplopiaCorectionViaVE,代码行数:31,代码来源:w32_text_bitmap.c


示例5: destroy

bool Bitmap::create(int widthPixels, int heightPixels)
{
    destroy();

    width = widthPixels;
    height = heightPixels;
    pitch = ((width * 32 + 31) & ~31) >> 3;
    dc = CreateCompatibleDC(0);

    if (!dc)
        return false;

    memset(&info, 0, sizeof(info));

    info.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
    info.bmiHeader.biBitCount = 32;
    info.bmiHeader.biWidth = width;
    info.bmiHeader.biHeight = -height;
    info.bmiHeader.biCompression = BI_RGB;
    info.bmiHeader.biPlanes = 1;

    hBitmap = CreateDIBSection(dc, &info, DIB_RGB_COLORS,
                               reinterpret_cast<void**>(&m_pBits), 0, 0);

    if (!hBitmap)
    {
        destroy();
        return false;
    }

    GdiFlush();
    return true;
}
开发者ID:tuannsofta,项目名称:kinect4bag,代码行数:33,代码来源:bitmap.cpp


示例6: wf_create_dib

HBITMAP wf_create_dib(wfInfo* wfi, int width, int height, int bpp, uint8* data)
{
	HDC hdc;
	int negHeight;
	HBITMAP bitmap;
	BITMAPINFO bmi;
	uint8* cdata = NULL;

	/**
	 * See: http://msdn.microsoft.com/en-us/library/dd183376
	 * if biHeight is positive, the bitmap is bottom-up
	 * if biHeight is negative, the bitmap is top-down
	 * Since we get top-down bitmaps, let's keep it that way
	 */

	negHeight = (height < 0) ? height : height * (-1);

	hdc = GetDC(NULL);
	bmi.bmiHeader.biSize = sizeof(BITMAPINFO);
	bmi.bmiHeader.biWidth = width;
	bmi.bmiHeader.biHeight = negHeight;
	bmi.bmiHeader.biPlanes = 1;
	bmi.bmiHeader.biBitCount = 24;
	bmi.bmiHeader.biCompression = BI_RGB;
	bitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, (void**) &cdata, NULL, 0);

	if (data != NULL)
		freerdp_image_convert(data, cdata, width, height, bpp, 24, wfi->clrconv);

	ReleaseDC(NULL, hdc);
	GdiFlush();

	return bitmap;
}
开发者ID:zzzhou,项目名称:FreeRDP,代码行数:34,代码来源:wf_graphics.c


示例7: GdiFlush

void    plTextGenerator::FlushToHost( void )
{
#if HS_BUILD_FOR_WIN32
    // Flush the GDI first, to make sure it's done
    GdiFlush();

    // Now copy our alpha channel over. I hate the GDI
    uint32_t      i = fHost->fWidth * fHost->fHeight;
    uint32_t      *dest = fWinRGBBits;
    uint8_t       *src = fWinAlphaBits;

/*  while( i-- )
    {
        *dest &= 0x00ffffff;
        *dest |= ( *src ) << 24;
//      *dest |= ( *dest << 16 ) & 0xff000000;
        dest++;
        src++;
    }
*/
    do
    {
        i--;
        dest[ i ] &= 0x00ffffff;
        dest[ i ] |= src[ i ] << 24;
    } while( i );
#endif

    // Dirty the mipmap's deviceRef, if there is one
    if( fHost->GetDeviceRef() != nil )
        fHost->GetDeviceRef()->SetDirty( true );
}
开发者ID:Asteral,项目名称:Plasma,代码行数:32,代码来源:plTextGenerator.cpp


示例8: AeroPaintControl

static void AeroPaintControl(HWND hwnd, HDC hdc, WNDPROC OldWndProc, UINT msg = WM_PRINT, LPARAM lpFlags = PRF_CLIENT | PRF_NONCLIENT)
{
	HBITMAP hBmp, hOldBmp;
	RECT rc; GetClientRect(hwnd, &rc);
	BYTE *pBits;

	HDC tempDC = CreateCompatibleDC(hdc);

	BITMAPINFO bmi;
	bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
	bmi.bmiHeader.biWidth = rc.right;
	bmi.bmiHeader.biHeight = -rc.bottom;
	bmi.bmiHeader.biPlanes = 1;
	bmi.bmiHeader.biBitCount = 32;
	bmi.bmiHeader.biCompression = BI_RGB;
	hBmp = CreateDIBSection(tempDC, &bmi, DIB_RGB_COLORS, (void **)&pBits, NULL, 0);

	hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);

	//paint
	SetPropA(hwnd, "Miranda.AeroRender.Active", (HANDLE)TRUE);
	mir_callNextSubclass(hwnd, OldWndProc, msg, (WPARAM)tempDC, lpFlags);
	SetPropA(hwnd, "Miranda.AeroRender.Active", (HANDLE)FALSE);

	// Fix alpha channel
	GdiFlush();
	for (int i = 0; i < rc.right*rc.bottom; i++, pBits += 4)
	if (!pBits[3]) pBits[3] = 255;

	//Copy to output
	BitBlt(hdc, 0, 0, rc.right, rc.bottom, tempDC, 0, 0, SRCCOPY);
	SelectObject(tempDC, hOldBmp);
	DeleteObject(hBmp);
	DeleteDC(tempDC);
}
开发者ID:Ganster41,项目名称:miranda-ng,代码行数:35,代码来源:options.cpp


示例9: __glutFinishMenu

void
__glutFinishMenu(Window win, int x, int y)
{

  unmapMenu(__glutMappedMenu);

  /* XXX Put in a GdiFlush just in case.  Probably unnecessary. -mjk  */
  GdiFlush();

  if (__glutMenuStatusFunc) {
    __glutSetWindow(__glutMenuWindow);
    __glutSetMenu(__glutMappedMenu);

    /* Setting __glutMappedMenu to NULL permits operations that
       change menus or destroy the menu window again. */
    __glutMappedMenu = NULL;

    __glutMenuStatusFunc(GLUT_MENU_NOT_IN_USE, x, y);
  }
  /* Setting __glutMappedMenu to NULL permits operations that
     change menus or destroy the menu window again. */
  __glutMappedMenu = NULL;

  /* If an item is selected and it is not a submenu trigger,
     generate menu callback. */
  if (__glutItemSelected && !__glutItemSelected->isTrigger) {
    __glutSetWindow(__glutMenuWindow);
    /* When menu callback is triggered, current menu should be
       set to the callback menu. */
    __glutSetMenu(__glutItemSelected->menu);
    __glutItemSelected->menu->select(__glutItemSelected->value);
  }
  __glutMenuWindow = NULL;
}
开发者ID:kendallb,项目名称:scitech-mgl,代码行数:34,代码来源:win32_menu.c


示例10: gdk_win32_display_sync

static void
gdk_win32_display_sync (GdkDisplay * display)
{
  g_return_if_fail (display == _gdk_display);

  GdiFlush ();
}
开发者ID:sam-m888,项目名称:gtk,代码行数:7,代码来源:gdkdisplay-win32.c


示例11: g_CreateHbitmapFromGdiplusBitmapData32bpp

HBITMAP g_CreateHbitmapFromGdiplusBitmapData32bpp(const Gdiplus::BitmapData & pBitmapData)
{
	pfc::array_t<t_uint8> bm_data;
	bm_data.set_size(sizeof(BITMAPINFOHEADER) + sizeof(RGBQUAD) * 0);
	bm_data.fill(0);

	BITMAPINFOHEADER bmi;
	memset(&bmi, 0, sizeof(bmi));

	bmi.biSize = sizeof(bmi);
	bmi.biWidth = pBitmapData.Width;
	bmi.biHeight = -pBitmapData.Height;
	bmi.biPlanes = 1;
	bmi.biBitCount = 32;
	bmi.biCompression = BI_RGB;
	bmi.biClrUsed = 0;
	bmi.biClrImportant = 0;

	BITMAPINFO & bi = *(BITMAPINFO*)bm_data.get_ptr();

	bi.bmiHeader = bmi;

	void * data = 0;
	HBITMAP bm = CreateDIBSection(0, &bi, DIB_RGB_COLORS, &data, 0, 0);

	if (data)
	{
		char * ptr = (char*)data;

		GdiFlush();

		memcpy(ptr, pBitmapData.Scan0, pBitmapData.Stride*pBitmapData.Height);
	}
	return bm;
}
开发者ID:9060,项目名称:columns_ui,代码行数:35,代码来源:gdiplus.cpp


示例12: GDI_LockTexture

static int
GDI_LockTexture(SDL_Renderer * renderer, SDL_Texture * texture,
                const SDL_Rect * rect, int markDirty, void **pixels,
                int *pitch)
{
    GDI_TextureData *data = (GDI_TextureData *) texture->driverdata;

    if (data->yuv) {
        return SDL_SW_LockYUVTexture(data->yuv, rect, markDirty, pixels,
                                     pitch);
    } else if (data->pixels) {
#ifndef _WIN32_WCE
        /* WinCE has no GdiFlush */
        GdiFlush();
#endif
        *pixels =
            (void *) ((Uint8 *) data->pixels + rect->y * data->pitch +
                      rect->x * SDL_BYTESPERPIXEL(texture->format));
        *pitch = data->pitch;
        return 0;
    } else {
        SDL_SetError("No pixels available");
        return -1;
    }
}
开发者ID:weimingtom,项目名称:eriri_lua,代码行数:25,代码来源:SDL_gdirender.c


示例13: icvGetBitmapData

// returns TRUE if there is a problem such as ERROR_IO_PENDING.
static bool icvGetBitmapData( CvWindow* window, SIZE* size, int* channels, void** data )
{
    BITMAP bmp;
    GdiFlush();
    HGDIOBJ h = GetCurrentObject( window->dc, OBJ_BITMAP );
    if( size )
        size->cx = size->cy = 0;
    if( data )
        *data = 0;

    if (h == NULL)
        return true;
    if (GetObject(h, sizeof(bmp), &bmp) == 0)
        return true;

    if( size )
    {
        size->cx = abs(bmp.bmWidth);
        size->cy = abs(bmp.bmHeight);
    }

    if( channels )
        *channels = bmp.bmBitsPixel/8;

    if( data )
        *data = bmp.bmBits;

    return false;
}
开发者ID:SCS-B3C,项目名称:OpenCV2-2,代码行数:30,代码来源:window_w32.cpp


示例14: SaveAlpha

void SaveAlpha(LPRECT lpRect)
{
    if (skin.colSavedBits) {
        mir_free(skin.colSavedBits);
        skin.colSavedBits = 0;
    }
    GdiFlush();

    if (lpRect->left < 0) lpRect->left = 0;
    if (lpRect->top < 0) lpRect->top = 0;
    if (lpRect->right - lpRect->left > skin.iWidth) lpRect->right = lpRect->left + skin.iWidth;
    if (lpRect->bottom - lpRect->top > skin.iHeight) lpRect->bottom = lpRect->top + skin.iHeight;

    int x = lpRect->left;
    int y = lpRect->top;
    int w = lpRect->right - lpRect->left;
    int h = lpRect->bottom - lpRect->top;

    skin.colSavedBits = (COLOR32 *)mir_alloc(sizeof(COLOR32) * w * h);
    COLOR32 *p1 = skin.colSavedBits;

    for (int i = 0; i < h; i++) {
        if (i+y < 0) continue;
        if (i+y >= skin.iHeight) break;
        COLOR32 *p2 = skin.colBits + (y+i)*skin.iWidth + x;
        for (int j = 0; j < w; j++) {
            if (j+x < 0) continue;
            if (j+x >= skin.iWidth) break;
            *p1++ = *p2++;
        }
    }
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:32,代码来源:bitmap_func.cpp


示例15: IupGLWait

void IupGLWait(int gl)
{
  if (gl)
    glFinish();
  else
    GdiFlush();
}
开发者ID:DavidPhillipOster,项目名称:IupCocoa,代码行数:7,代码来源:iup_glcanvas_win.c


示例16: gdk_gl_pixmap_impl_win32_wait_gdk

static void
gdk_gl_pixmap_impl_win32_wait_gdk (GdkGLDrawable *gldrawable)
{
  GdiFlush ();

  /* Sync. */
  gdk_gl_pixmap_sync_gdk (GDK_GL_PIXMAP (gldrawable));
}
开发者ID:Distrotech,项目名称:gtkglext,代码行数:8,代码来源:gdkglpixmap-win32.c


示例17: drv_win_screen_update

//static
void drv_win_screen_update(void)
{
    GdiFlush();

    eline = 1;
    RedrawWindow( hWnd, 0, 0, RDW_INVALIDATE/*|RDW_NOERASE*/ );

}
开发者ID:animotron,项目名称:animos,代码行数:9,代码来源:win_screen.c


示例18: cdflush

/* 
%F cdFlush para Printer.
Termina uma pagina e inicia outra.
*/
static void cdflush(cdCtxCanvas *ctxcanvas)
{
  GdiFlush();
  EndPage(ctxcanvas->hDC);

  StartPage(ctxcanvas->hDC);
  cdwRestoreDC(ctxcanvas);
}
开发者ID:gcfavorites,项目名称:tastools,代码行数:12,代码来源:cdwprn.c


示例19: CreateOpaqueRgn

// code from Clist Modern by FYR
HRGN CreateOpaqueRgn(BYTE level, bool bOpaque)
{
    if (!skin.colBits)
        return NULL;

    GdiFlush();

    RGBQUAD *buff = (RGBQUAD *)skin.colBits;

    int x,y;
    unsigned int cRect = 64;
    PRGNDATA pRgnData = (PRGNDATA)malloc(sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
    memset(pRgnData, 0, sizeof(RGNDATAHEADER));
    pRgnData->rdh.dwSize = sizeof(RGNDATAHEADER);
    pRgnData->rdh.iType = RDH_RECTANGLES;

    for (y = 0; y < skin.iHeight; ++y) {
        bool inside = false;
        bool lastin = false;
        unsigned int entry = 0;

        for (x = 0; x < skin.iWidth; ++x) {
            inside = bOpaque ? (buff->rgbReserved > level) : (buff->rgbReserved < level);
            ++buff;

            if (inside != lastin) {
                if (inside) {
                    lastin = true;
                    entry = x;
                }
                else {
                    if (pRgnData->rdh.nCount == cRect) {
                        cRect = cRect + 64;
                        pRgnData = (PRGNDATA)realloc(pRgnData, sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
                    }

                    SetRect(((LPRECT)pRgnData->Buffer) + pRgnData->rdh.nCount, entry, skin.iHeight - y, x, skin.iHeight - y + 1);
                    pRgnData->rdh.nCount++;
                    lastin = false;
                }
            }
        }

        if (lastin) {
            if (pRgnData->rdh.nCount == cRect) {
                cRect = cRect + 64;
                pRgnData = (PRGNDATA)realloc(pRgnData, sizeof(RGNDATAHEADER) + (cRect)*sizeof(RECT));
            }

            SetRect(((LPRECT)pRgnData->Buffer) + pRgnData->rdh.nCount, entry, skin.iHeight - y, x, skin.iHeight - y + 1);
            pRgnData->rdh.nCount++;
        }
    }

    HRGN hRgn = ExtCreateRegion(NULL, sizeof(RGNDATAHEADER) + pRgnData->rdh.nCount*sizeof(RECT), (LPRGNDATA)pRgnData);
    free(pRgnData);
    return hRgn;
}
开发者ID:0xmono,项目名称:miranda-ng,代码行数:59,代码来源:bitmap_func.cpp


示例20: GdiFlush

// Copy data from the memory bitmap into a buffer
void
vncDesktop::CopyToBuffer(const rfb::Rect &rect, BYTE *destbuff, UINT destbuffsize)
{
	// Finish drawing anything in this thread 
	// Wish we could do this for the whole system - maybe we should
	// do something with LockWindowUpdate here.
	GdiFlush();

	// Are we being asked to blit from the DIBsection to itself?
	if (destbuff == m_DIBbits) {
		// Yes.  Ignore the request!
		return;
	}

	int y_inv;
	BYTE * destbuffpos;

	// Calculate the scanline-ordered y position to copy from
	y_inv = m_scrinfo.framebufferHeight-rect.tl.y-(rect.br.y-rect.tl.y);

	// Calculate where in the output buffer to put the data
	destbuffpos = destbuff + (m_bytesPerRow * rect.tl.y);

	// Set the number of bytes for GetDIBits to actually write
	// NOTE : GetDIBits pads the destination buffer if biSizeImage < no. of bytes required
	m_bminfo.bmi.bmiHeader.biSizeImage = (rect.br.y-rect.tl.y) * m_bytesPerRow;

	// Get the actual bits from the bitmap into the bit buffer
	// If fast (DIBsection) blits are disabled then use the old GetDIBits technique
	if (m_DIBbits == NULL) {
		if (GetDIBits(m_hmemdc, m_membitmap, y_inv,
					(rect.br.y-rect.tl.y), destbuffpos,
					&m_bminfo.bmi, DIB_RGB_COLORS) == 0)
		{
			_RPT1(_CRT_WARN, "vncDesktop : [1] GetDIBits failed! %d\n", GetLastError());
			_RPT3(_CRT_WARN, "vncDesktop : thread = %d, DC = %d, bitmap = %d\n", omni_thread::self(), m_hmemdc, m_membitmap);
			_RPT2(_CRT_WARN, "vncDesktop : y = %d, height = %d\n", y_inv, (rect.br.y-rect.tl.y));
		}
	} else {
		// Fast blits are enabled.  [I have a sneaking suspicion this will never get used, unless
		// something weird goes wrong in the code.  It's here to keep the function general, though!]

		int bytesPerPixel = m_scrinfo.format.bitsPerPixel / 8;
		BYTE *srcbuffpos = (BYTE*)m_DIBbits;

		srcbuffpos += (m_bytesPerRow * rect.tl.y) + (bytesPerPixel * rect.tl.x);
		destbuffpos += bytesPerPixel * rect.tl.x;

		int widthBytes = (rect.br.x-rect.tl.x) * bytesPerPixel;

		for(int y = rect.tl.y; y < rect.br.y; y++)
		{
			memcpy(destbuffpos, srcbuffpos, widthBytes);
			srcbuffpos += m_bytesPerRow;
			destbuffpos += m_bytesPerRow;
		}
	}
}
开发者ID:lizard007,项目名称:msf3,代码行数:59,代码来源:vncdesktop.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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