Jump to content

View more

View more

Image of the Day

Inventory ! Va falloir trouver une autre couleur pour le cadre D: #AzTroScreenshot #screenshotsaturday https://t.co/PvxhGL7cOH
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

DIRECTX9 - HDC TO SURFACE

4: Adsense

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
1 reply to this topic

#1 Starkman   Members   

106
Like
0Likes
Like

Posted 13 January 2013 - 02:55 AM

Hi,

I have two applications: The first application contains a Picturebox with a flower image and the second application is based on Directx 9 and contains a directx surface. Now I want to copy the picture box image data(flower) from the first application into the surface of the Directx application. But all I get is a black screen.

 

 

LPDIRECT3DDEVICE9 l_Device = My_device ;
 
LPDIRECT3DSURFACE9 l_SurfaceHDC, l_Surface;
 
My_3DTexture->GetSurfaceLevel(0,&l_Surface);
 
HDC hDC = GetDC((HWND)MyPictureBoxHWND); //use WINAPI to get my picturebox DC handle
 
l_SurfaceHDC->GetDC(&hDC);   // i think i'm wrong here but how we can copy flower image data into my surface ?
 
l_Device->StretchRect(l_SurfaceHDC,NULL, l_Surface,NULL,D3DTEXF_NONE);
 
l_SurfaceHDC->Release();
 
l_Device->SetTexture( 0,My_3DTexture);

 

 

Thanks.



#2 Starkman   Members   

106
Like
0Likes
Like

Posted 13 January 2013 - 08:25 AM

i'v done it 


Edited by Starkman, 13 January 2013 - 08:40 AM.





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.