I looked on the forum and saw a post from 2005, but it is not correct with the newer juce code.
So I am asking again. How can I take a juce image and covert it and get a handle to a HBITMAP and the same idea on the MAc?
So this is what I am trying but it does not work. It actually crashes on StretchDIBits.
What am I doing wrong?
void DrawImage( Image *pImage, int x, int y, it w, int h, int desWidth, int desHeight )
{
::SetMapMode (m_hDC, MM_TEXT);
NativeImageType imageType;
imageType.convert(*pImage);
WindowsBitmapImage *p = (WindowsBitmapImage*) &imageType;
int error = ::StretchDIBits (m_hDC, x, y, desWidth, desHeight,
0, 0, w, h, p->bitmapData, (const BITMAPINFO*) &p->bitmapInfo, DIB_RGB_COLORS, SRCCOPY);
}