Jump to content
  • Advertisement
Sign in to follow this  

Render a control to a texture

This topic is 3676 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. I am trying to render a flash to a d3d texture. This is more of a winapi question than a directx question. I am currently trying to use bitblt to copy the device context of my flash control onto an hbitmap. After that, I will use the D3DxCreateTextureFromMemory to render my hbitmap. The following is how I am doing it.
HBITMAP FlashController::getTexture(HWND hWnd)
	HDC flashDC = GetDC((HWND)flashPlayer->Handle.ToPointer());
	HDC destDC = CreateCompatibleDC(flashDC);
	HBITMAP hBMP = CreateCompatibleBitmap(destDC,

	SelectObject(destDC, hBMP);
		   SRCCOPY) == 0)
		return NULL;

	BITMAP bmp;
	return hBMP;

However when I check the bmp's bmBits is pointing to 0 which tells me my image didn't get loaded correctly. Does anyone see why my code wouldn't work here? Thanks!

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!