[VB6 - API] - using bitblt in same picturebox
i build 1 code for put 1 image in 1 picturebox, and until here works fine:
Code:
ImageWithControls Extender.Container.hwnd, picGraphicsEffects.hDC
picGraphicsEffects.Picture = picGraphicsEffects.Image
Call BitBlt(picGraphicsEffects.hDC, 0, 0, PicAnimation(lngActualSubImage).Width, PicAnimation(lngActualSubImage).Height, picGraphicsEffects.hDC, lngOldPosX, lngOldPosY, vbSrcCopy)
then i use the bitblt for copy 1 part of that image to the same picturebox. the result of the function is '1'. but i can't see the part of the image:(
because the position isn't correct. i know these because i debug it and the position is correct, but the bitblt interpret it by 0. and i don't know why:(
can anyone explain to me what isn't right?
thanks
Re: [VB6 - API] - using bitblt in same picturebox
BitBlt uses pixel not twips. Ensure AutoRedraw=True or picGraphicsEffects is not obstructed. If AutoRedraw is False and you refresh picGraphicsEffects then you erase what you just BitBlt.
1 Attachment(s)
Re: [VB6 - API] - using bitblt in same picturebox
Quote:
Originally Posted by
LaVolpe
BitBlt uses pixel not twips. Ensure AutoRedraw=True or picGraphicsEffects is not obstructed. If AutoRedraw is False and you refresh picGraphicsEffects then you erase what you just BitBlt.
Code:
ImageWithControls Extender.Container.hwnd, picGraphicsEffects.hDC
picGraphicsEffects.Picture = picGraphicsEffects.Image
picGraphicsEffects.AutoRedraw = False
Call BitBlt(picGraphicsEffects.hDC, 0, 0, PicAnimation(lngActualSubImage).Width, PicAnimation(lngActualSubImage).Height, picGraphicsEffects.hDC, lngOldPosX, lngOldPosY, vbSrcCopy)
picGraphicsEffects.Picture = picGraphicsEffects.Image
picGraphicsEffects.AutoRedraw = True
i continue with same problem:(
see the image... the opacy works(not in some positions:().
but why that bug?
Re: [VB6 - API] - using bitblt in same picturebox
May not matter here, but looks like you have your AutoRedraw True/False reversed:
Set to true, BitBlt, then set to false after .Picture=.Image
Also, BitBlt does not transfer transparency.
The stuff at the very top and very bottom of our bigger image could be related to calculation error.
Ensure PicAnimation(lngActualSubImage).Width+lngOldPosX is not greater than picGraphicsEffects.ScaleWidth (pixels)
Ensure PicAnimation(lngActualSubImage).Height+lngOldPosY is not greater than picGraphicsEffects.ScaleHeight (pixels)
Re: [VB6 - API] - using bitblt in same picturebox
Quote:
Originally Posted by
LaVolpe
May not matter here, but looks like you have your AutoRedraw True/False reversed:
Set to true, BitBlt, then set to false after .Picture=.Image
Also, BitBlt does not transfer transparency.
The stuff at the very top and very bottom of our bigger image could be related to calculation error.
Ensure PicAnimation(lngActualSubImage).Width+lngOldPosX is not greater than picGraphicsEffects.ScaleWidth (pixels)
Ensure PicAnimation(lngActualSubImage).Height+lngOldPosY is not greater than picGraphicsEffects.ScaleHeight (pixels)
i'm confuse:(
i try do some changes that you said, but not with sucess:(
Re: [VB6 - API] - using bitblt in same picturebox
if the object the scale size is more big than object size, the bitblt can copy what is in scalesize(but not in object size... what i mean is copy what u can't see)?