Jump to content
  • Advertisement
Sign in to follow this  
b1gjo3

help drawing stream image

This topic is 3854 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.

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!