Jump to content

  • Log In with Google      Sign In   
  • Create Account

Question about HDC to SURFACE


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 kgs   Members   -  Reputation: 205

Like
0Likes
Like

Posted 25 February 2013 - 09:26 AM

I want to get a window image as texture using PrintWindow.
I don't know what's wrong with my code...
This is my code:
	RECT rect;
	GetWindowRect(mhMainWnd, &rect);
	HDC hScrDC = GetDC(mhMainWnd);
	HDC hMemDC = CreateCompatibleDC(hScrDC);
	PrintWindow(mhMainWnd, hMemDC, 0);
	LPDIRECT3DSURFACE9 surf = NULL;
	surf->GetDC(&hMemDC);
	mTestTex->GetSurfaceLevel(0, &surf);
	surf->ReleaseDC(hMemDC);
	surf->Release();
	DeleteDC(hMemDC) ;
	ReleaseDC(NULL, hScrDC);
Any help would be appriciated!
Thanks!

Edited by kgs, 25 February 2013 - 08:14 PM.

My english is very poor!

Sponsor:

#2 BornToCode   Members   -  Reputation: 925

Like
0Likes
Like

Posted 25 February 2013 - 12:53 PM

Make sure your code is formated properly.



#3 kgs   Members   -  Reputation: 205

Like
0Likes
Like

Posted 25 February 2013 - 08:21 PM

 

Make sure your code is formated properly.

 
fixed!!
My english is very poor!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS