Hey guys. I am reading in a cdg file (karaoke) for mp3+g playback. I have it all working, but I have one little problem. The cd+g is meant to be played at the size 300 x 216, but I want to go 2x, 3x, or fullscreen of that. Problem is that when I do a stretchblt instead of bitblt it gets really slow
is there some alternative I can use other than stretchblt that will size a 300 x 216 bitmap to double or triple the size without such a performance hit?
Here is some of my code: Is there some way I can make this faster?
Code:int THEWIDTH = 600;desired width of bitmap int THEHEIGHT = 438; desired height of bitmap BYTE pixles[64800]; //300*216 this holds the image i want to put in the bitmap CDC* pDC = pKaraokeWindow.m_KaraokeWnd.GetDC(); CDC memdcX; memdcX.CreateCompatibleDC(pDC); // Set up a palette hBitmap = CreateDIBSection(NULL, lpbi, DIB_RGB_COLORS, NULL/*(LPVOID *)&pixels*/, NULL, 0 ); m_bitmap.DeleteObject(); m_bitmap.Attach(hBitmap); m_bitmap.SetBitmapBits(300*216,&pixels); memdcX.SelectPalette(&m_pPalette, FALSE); CBitmap* pBitmap = memdcX.SelectObject(&m_bitmap); //pDC->BitBlt(0,0,300,216 ,&memdcX,0,0,SRCCOPY); pDC->StretchBlt(0,0,THEWIDTH, THEHEIGHT, &memdcX, 0,0, 300, 216, SRCCOPY); memdcX.SelectObject(pBitmap); ReleaseDC(pDC);




Reply With Quote