Jump to content
  • Advertisement
Sign in to follow this  

how to make an overlay transparent.

This topic is 3853 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 Friends, I am trying to create an overlay and make it transparent so that I can see the preview screen through the overlay. I was able to do this in my desktop PC by color keying. But when I try to execute the same code in my PPC device(windows mobile 5.0), it is not giving me the desired result. The overlay shows the preview screen, but any updation in the preview screen is not reflected. It is virtually like taking a snapshot of the preview screen and loading to the overlay surface. Eg: if I click on the start menu, I can hear the sound of start menu popping up, but the user can't see the popped up menu. What I want is to make the overlay transparent and any updation on the screen should be visible to the user. The device I am using is of RGB surface and it supports source colorkeying. This is my code //Trying to set the src color keying DWORD dwFlag = DDOVER_SHOW | DDOVER_KEYSRCOVERRIDE; DDOVERLAYFX ovfx; ZeroMemory(&ovfx, sizeof(ovfx)); ovfx.dwSize = sizeof(ovfx); ovfx.dckSrcColorkey.dwColorSpaceLowValue = 0; // setting the color key value as 0(black) ovfx.dckSrcColorkey.dwColorSpaceHighValue = 0 // setting the color key value as 0(black) DDBLTFX ddbltfx; ddbltfx.dwSize = sizeof(ddbltfx); ddbltfx.dwFillColor = 0; //Filling the surface with 0(which is the color key) to make it transparent hRet = m_ pOverlaySurface->Blt(NULL, NULL, NULL,DDBLT_COLORFILL | DDBLT_KEYSRCOVERRIDE,&ddbltfx); RECT rs = {0, 0, 240, 320} hRet = m_pOverlaySurface->UpdateOverlay(&rs, m_pPrimarySurface, &rs, dwFlag, &ovfx); Please help Thanks in advance Sunil

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!