[VB6] - capture a parent(container) from an Activex Control(UserControl)
i have 1 code, that works fine, for capture the container(parent):
Code:
Public Sub CaptureContiner(DestinationHDC As Long, SourceHWND As Long, SourceX As Long, SourceY As Long, SourceWidth As Long, SourceHeight As Long)
'SourceHWND = GetDC(SourceHWND)
BitBlt DestinationHDC, 0, 0, SourceWidth, SourceHeight, SourceHWND, SourceX, SourceY, vbSrcCopy
End Sub
but when i use on in side of my control:
Code:
CaptureContiner PicAnimation(PicAnimation.Count - 1).hdc, UserControl.Parent.hdc, Extender.left, Extender.top, UserControl.Width, UserControl.Height
it only catch the parent(container) image without controls(but like an image):(
my error is these HDC?
UserControl.Parent.hdc???
or other?
Re: [VB6] - capture a parent(container) from an Activex Control(UserControl)
now catch with controls:
Code:
Public Sub CaptureContiner(DestinationHDC As Long, SourceHWND As Long, SourceX As Long, SourceY As Long, SourceWidth As Long, SourceHeight As Long)
SourceHWND = GetDC(SourceHWND)
BitBlt DestinationHDC, 0, 0, SourceWidth, SourceHeight, SourceHWND, SourceX, SourceY, vbSrcCopy
End Sub
'heres how i use it:
.....
CaptureContiner Picture2.hdc, UserControl.ContainerHwnd, _
Extender.Top, Extender.Left, Extender.Width, Extender.Height
....
but the problem is that i don't recive the right position:(
so heres the question: why the extender object don't give me correct values(but i see the results on form and i know the position is right)?
Re: [VB6] - capture a parent(container) from an Activex Control(UserControl)
now i put it to work. but i have 1 problem: how can i capture it without usercontrol?
i try clean what it inside of usercontrol, but by some reason, still catch it:(
any advices
Re: [VB6] - capture a parent(container) from an Activex Control(UserControl)
Code:
Public Sub CaptureContainer(DestinationHDC As Long, SourceHWND As Long, SourceX As Long, SourceY As Long, SourceWidth As Long, SourceHeight As Long)
SourceHWND = GetDC(SourceHWND)
BitBlt DestinationHDC, 0, 0, SourceWidth, SourceHeight, SourceHWND, SourceX, SourceY, vbSrcCopy
'StretchBlt DestinationHDC, 0, 0, SourceWidth, SourceHeight, SourceHWND, SourceX, SourceY, SourceWidth, SourceHeight, vbSrcCopy
End Sub
using these code i can capture the parent without a problem;)
my problem is: why i can't:
Code:
usercontrol.picture=nothing
usercontrol.maskpicture=nothing
(after these code i use the CaptureContainer() sub)
???
why the usercontrol isn't clean?
(unless i use 'doevents' before the CaptureContainer() sub)