Jump to content
  • Advertisement
Sign in to follow this  
b1gjo3

help drawing stream image

This topic is 3776 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

i cannot seem to get the image to draw onto this window that i have created. i think it has to do with my HDC variable but im not sure
					if (pbyteImage != NULL)
					{
						EdsGetLength(stream, &size);
						HDC dc = GetDC(evfWin->GetHWND());
						CImage image;
						CComPtr<IStream> stream = NULL;
						HGLOBAL hMem = ::GlobalAlloc(GMEM_MOVEABLE | GMEM_ZEROINIT, size);
						LPVOID pBuff = ::GlobalLock(hMem);
						memcpy(pBuff, pbyteImage, size);
						::GlobalUnlock(hMem);
						CreateStreamOnHGlobal(hMem, TRUE, &stream);
						image.Load(stream);
						CRect rect;
						GetWindowRect(evfWin->GetHWND(), &rect);

						//draw
						SetStretchBltMode(dc, COLORONCOLOR);
						image.StretchBlt(dc, 0, 0, rect.Width(), rect.Height(), 0, 0, image.GetWidth(), image.GetHeight(), SRCCOPY);
						image.Destroy();
						::GlobalFree(hMem);
						ReleaseDC(evfWin->GetHWND(), dc);
					}

Share this post


Link to post
Share on other sites
Advertisement
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!