i build 1 function for convert hdc to long variable:
but i belive that isn't work, because when i do:Code:Public Function ConvertPicturetoLong(PicControl As PictureBox) As Long Dim mdc As Long Dim mBMP As Long mdc = CreateCompatibleDC(PicControl.hDC) mBMP = CreateCompatibleBitmap(PicControl.hDC, PicControl.ScaleWidth, PicControl.ScaleHeight) SelectObject mdc, mBMP ConvertPicturetoLong = mBMP DeleteObject mBMP DeleteDC mdc End Function
because the bitblt() give me 0(zero). what isn't right?Code:dim s as long s = ConvertPicturetoLong(PicAnimation(PicAnimation.Count - 1)) PicAnimation(PicAnimation.Count - 1).Picture = Nothing Debug.Print BitBlt(PicAnimation(PicAnimation.Count - 1), 0, 0, UserControl.Width, UserControl.Height, s, 0, 0, vbSrcCopy)





Reply With Quote