So I have been trying to create a stretched bitmap from a bitmap that I receive via a function call and stretch it so a user defined size.
Here is my code that isn't working
// I know my bitmap even stretched is not over 64k
// For this please assume that bih and bmiHeader are valid if you find no problem with this code I can give you that information, 'thank you'.
// pSubBuffer - Buffer of bitmap
// bih is Bitmap info head for pSubBuffer
// bmiHeader is requested new info for new bitmap
BYTE* CreateStretchedBitmap(BYTE*pSubBuffer, BITMAPINFOHEADER bih, BITMAPINFOHEADER bmiHeader)
result = StretchBlt(hdcDst, 0,0, bmiHeader.biWidth, bmiHeader.biHeight, hdcSrc,0, 0, nWidth, nHeight, SRCCOPY);
// result is 1 here
HANDLE hDIB = GlobalAlloc(GHND, bmiHeader.biSizeImage);
char *lpbitmap = (char *)GlobalLock(hDIB);
result = GetDIBits(hdcDst, hbmNew, 0, bmiHeader.biHeight, lpbitmap, (BITMAPINFO*)&bmiHeader, DIB_RGB_COLORS);
// result returns 0 here and there is no error from GetLastError()