After blitting to the primary surface using BltFx (and using some of the effects), the result in the screen has those results, but the original surface (blitting source) doesn't. That means when the picturebox comes to be repainted, it will just blit the picture with no added effects. So the effects are pretty much lost.
What I've been trying to do is to make a copy of the primary surface back to the image surface so when the picture box is reblitted the effects are 'still there'. According to the DX7 SDK a primary surface can't be duplicated with DuplicateSurface, so I'm trying to get this to work:
I can't seem to get it to work, when the picture is repainted, the old image comes out, meaning the above copy code didn't do its work (no errors though). Or if I've got it completely wrong, what should I be doing?Code:Dim imgDC As Long Dim imgSurfDC As Long imgSurfDC = imgBuffer.GetDC 'imgBuffer - surface of image imgDC = CreateCompatibleDC(0) SelectObject frmMain.picMain.hdc, imgDC 'copy using blit BitBlt imgSurfDC, 0, 0, imgDesc.lWidth, imgDesc.lHeight, imgDC, 0, 0, vbSrcCopy 'clean up and delete DCs imgBuffer.ReleaseDC imgSurfDC DeleteDC imgDC




Reply With Quote