Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Get the image, from Where?

Thanks, Rene

But I also want to print out the invisible part (outside the
screen) of the PictureBox

I tried to use the BitBlt, but only got the visible part of the
PictureBox.

I am wondering if it is correct if I use the PictureBox1.hDC as
the source bitmap handle for the Blitting.

Or, may I just use the vbSrcCopy as the last parameter for the
BitBlt function?

Thanks

George

"Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
>If you want to print EXACTLY what you see on the screen then why don't you
>BitBlt() the screen area which is inside the PictureBox to the PictureBox
>and then Printer.PaintPicture the PictureBox.Image?
>
>--
>Hope this helps ...
>
>Rene Whitworth
>Whitworth Software Solutions - Germany
>http://www.w-s-s.de/Developer
>Please reply to the newsgroup :-)
>
[953 byte] By [George] at [2007-11-10 0:19:22]
# 1 Re: Get the image, from Where?
Thanks, Rene

But I also want to print out the invisible part (outside the
screen) of the PictureBox

I tried to use the BitBlt, but only got the visible part of the
PictureBox.

I am wondering if it is correct if I use the PictureBox1.hDC as
the source bitmap handle for the Blitting.

Or, may I just use the vbSrcCopy as the last parameter for the
BitBlt function?

Thanks

George

"Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
>If you want to print EXACTLY what you see on the screen then why don't you
>BitBlt() the screen area which is inside the PictureBox to the PictureBox
>and then Printer.PaintPicture the PictureBox.Image?
>
>--
>Hope this helps ...
>
>Rene Whitworth
>Whitworth Software Solutions - Germany
>http://www.w-s-s.de/Developer
>Please reply to the newsgroup :-)
>
George at 2007-11-11 20:05:02 >
# 2 Re: Get the image, from Where?
Using BitBlt() you'll only get the visible part as the grid isn't part of
the picturebox.
I'm sorry, but I can't think of any (other) way to accomplish what you want
:-(

--
Rene Whitworth
Whitworth Software Solutions - Germany
http://www.w-s-s.de/Developer
Please reply to the newsgroup :-)

"George" <gyu005@student.auckland.ac.nz> schrieb im Newsbeitrag
news:38cc2004$1@news.dev-archive.com...
>
> Thanks, Rene
>
> But I also want to print out the invisible part (outside the
> screen) of the PictureBox
>
> I tried to use the BitBlt, but only got the visible part of the
> PictureBox.
>
> I am wondering if it is correct if I use the PictureBox1.hDC as
> the source bitmap handle for the Blitting.
>
> Or, may I just use the vbSrcCopy as the last parameter for the
> BitBlt function?
>
> Thanks
>
> George
>
> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
> >If you want to print EXACTLY what you see on the screen then why don't
you
> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
> >and then Printer.PaintPicture the PictureBox.Image?
> >
> >--
> >Hope this helps ...
> >
> >Rene Whitworth
> >Whitworth Software Solutions - Germany
> >http://www.w-s-s.de/Developer
> >Please reply to the newsgroup :-)
> >
>
>
Ren Whitworth at 2007-11-11 20:06:08 >
# 3 Re: Get the image, from Where?
Using BitBlt() you'll only get the visible part as the grid isn't part of
the picturebox.
I'm sorry, but I can't think of any (other) way to accomplish what you want
:-(

--
Rene Whitworth
Whitworth Software Solutions - Germany
http://www.w-s-s.de/Developer
Please reply to the newsgroup :-)

"George" <gyu005@student.auckland.ac.nz> schrieb im Newsbeitrag
news:38cc2004$1@news.dev-archive.com...
>
> Thanks, Rene
>
> But I also want to print out the invisible part (outside the
> screen) of the PictureBox
>
> I tried to use the BitBlt, but only got the visible part of the
> PictureBox.
>
> I am wondering if it is correct if I use the PictureBox1.hDC as
> the source bitmap handle for the Blitting.
>
> Or, may I just use the vbSrcCopy as the last parameter for the
> BitBlt function?
>
> Thanks
>
> George
>
> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
> >If you want to print EXACTLY what you see on the screen then why don't
you
> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
> >and then Printer.PaintPicture the PictureBox.Image?
> >
> >--
> >Hope this helps ...
> >
> >Rene Whitworth
> >Whitworth Software Solutions - Germany
> >http://www.w-s-s.de/Developer
> >Please reply to the newsgroup :-)
> >
>
>
Ren Whitworth at 2007-11-11 20:07:05 >
# 4 Re: Get the image, from Where?
Did you try using OleDraw API with the MSFlexiGrid?

Enum DVASPECT
DVASPECT_CONTENT = 1
DVASPECT_THUMBNAIL = 2
DVASPECT_ICON = 4
DVASPECT_DOCPRINT = 8
End Enum

Declare Function OleDraw lib "ole32" (ByVal pUnk As Object, _
ByVal dwAspect As DVASPECT, _
ByVal hdcDraw As Long, _
lprcBounds As RECT) As Long

--
Eduardo A. Morcillo
http://www.domaindlx.com/e_morcillo
"George" <gyu005@student.auckland.ac.nz> wrote in message
news:38cc2004$1@news.dev-archive.com...
>
> Thanks, Rene
>
> But I also want to print out the invisible part (outside the
> screen) of the PictureBox
>
> I tried to use the BitBlt, but only got the visible part of the
> PictureBox.
>
> I am wondering if it is correct if I use the PictureBox1.hDC as
> the source bitmap handle for the Blitting.
>
> Or, may I just use the vbSrcCopy as the last parameter for the
> BitBlt function?
>
> Thanks
>
> George
>
> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
> >If you want to print EXACTLY what you see on the screen then why don't
you
> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
> >and then Printer.PaintPicture the PictureBox.Image?
> >
> >--
> >Hope this helps ...
> >
> >Rene Whitworth
> >Whitworth Software Solutions - Germany
> >http://www.w-s-s.de/Developer
> >Please reply to the newsgroup :-)
> >
>
>
Eduardo A. Morcillo at 2007-11-11 20:08:11 >
# 5 Re: Get the image, from Where?
Did you try using OleDraw API with the MSFlexiGrid?

Enum DVASPECT
DVASPECT_CONTENT = 1
DVASPECT_THUMBNAIL = 2
DVASPECT_ICON = 4
DVASPECT_DOCPRINT = 8
End Enum

Declare Function OleDraw lib "ole32" (ByVal pUnk As Object, _
ByVal dwAspect As DVASPECT, _
ByVal hdcDraw As Long, _
lprcBounds As RECT) As Long

--
Eduardo A. Morcillo
http://www.domaindlx.com/e_morcillo
"George" <gyu005@student.auckland.ac.nz> wrote in message
news:38cc2004$1@news.dev-archive.com...
>
> Thanks, Rene
>
> But I also want to print out the invisible part (outside the
> screen) of the PictureBox
>
> I tried to use the BitBlt, but only got the visible part of the
> PictureBox.
>
> I am wondering if it is correct if I use the PictureBox1.hDC as
> the source bitmap handle for the Blitting.
>
> Or, may I just use the vbSrcCopy as the last parameter for the
> BitBlt function?
>
> Thanks
>
> George
>
> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
> >If you want to print EXACTLY what you see on the screen then why don't
you
> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
> >and then Printer.PaintPicture the PictureBox.Image?
> >
> >--
> >Hope this helps ...
> >
> >Rene Whitworth
> >Whitworth Software Solutions - Germany
> >http://www.w-s-s.de/Developer
> >Please reply to the newsgroup :-)
> >
>
>
Eduardo A. Morcillo at 2007-11-11 20:09:16 >
# 6 Re: Get the image, from Where?
Thanks Eduardo,

Good idea, ture! I tried but still nothing. I think I probably
mis-used the OleDraw function, like

OleDraw PictureBox1.Image, 1, Printer.hDC, rect1

or

OleDraw PictureBox1.Image, 1, PictureBox2.hDC, rect1

where PictureBox1.Image is the source image, PictureBox2 or
Printer are the target.

Expecting some hints for how to set these parameters, especially
for the source image one -- PictureBox1.Image which, I think,
is the main problem as I can get nothing from it (so I guess
it contains nothing about the image of this PictureBox1). If so,
where can I get the right image object handle?

Thanks

George

"Eduardo A. Morcillo" <edanmo@geocities.com> wrote:
>Did you try using OleDraw API with the MSFlexiGrid?
>
>Enum DVASPECT
> DVASPECT_CONTENT = 1
> DVASPECT_THUMBNAIL = 2
> DVASPECT_ICON = 4
> DVASPECT_DOCPRINT = 8
>End Enum
>
>Declare Function OleDraw lib "ole32" (ByVal pUnk As Object, _
> ByVal dwAspect As DVASPECT, _
> ByVal hdcDraw As Long, _
> lprcBounds As RECT) As Long
>
>--
>Eduardo A. Morcillo
>http://www.domaindlx.com/e_morcillo
>"George" <gyu005@student.auckland.ac.nz> wrote in message
>news:38cc2004$1@news.dev-archive.com...
>>
>> Thanks, Rene
>>
>> But I also want to print out the invisible part (outside the
>> screen) of the PictureBox
>>
>> I tried to use the BitBlt, but only got the visible part of the
>> PictureBox.
>>
>> I am wondering if it is correct if I use the PictureBox1.hDC as
>> the source bitmap handle for the Blitting.
>>
>> Or, may I just use the vbSrcCopy as the last parameter for the
>> BitBlt function?
>>
>> Thanks
>>
>> George
>>
>> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
>> >If you want to print EXACTLY what you see on the screen then why don't
>you
>> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
>> >and then Printer.PaintPicture the PictureBox.Image?
>> >
>> >--
>> >Hope this helps ...
>> >
>> >Rene Whitworth
>> >Whitworth Software Solutions - Germany
>> >http://www.w-s-s.de/Developer
>> >Please reply to the newsgroup :-)
>> >
>>
>>
>
>
George at 2007-11-11 20:10:08 >
# 7 Re: Get the image, from Where?
Thanks Eduardo,

Good idea, ture! I tried but still nothing. I think I probably
mis-used the OleDraw function, like

OleDraw PictureBox1.Image, 1, Printer.hDC, rect1

or

OleDraw PictureBox1.Image, 1, PictureBox2.hDC, rect1

where PictureBox1.Image is the source image, PictureBox2 or
Printer are the target.

Expecting some hints for how to set these parameters, especially
for the source image one -- PictureBox1.Image which, I think,
is the main problem as I can get nothing from it (so I guess
it contains nothing about the image of this PictureBox1). If so,
where can I get the right image object handle?

Thanks

George

"Eduardo A. Morcillo" <edanmo@geocities.com> wrote:
>Did you try using OleDraw API with the MSFlexiGrid?
>
>Enum DVASPECT
> DVASPECT_CONTENT = 1
> DVASPECT_THUMBNAIL = 2
> DVASPECT_ICON = 4
> DVASPECT_DOCPRINT = 8
>End Enum
>
>Declare Function OleDraw lib "ole32" (ByVal pUnk As Object, _
> ByVal dwAspect As DVASPECT, _
> ByVal hdcDraw As Long, _
> lprcBounds As RECT) As Long
>
>--
>Eduardo A. Morcillo
>http://www.domaindlx.com/e_morcillo
>"George" <gyu005@student.auckland.ac.nz> wrote in message
>news:38cc2004$1@news.dev-archive.com...
>>
>> Thanks, Rene
>>
>> But I also want to print out the invisible part (outside the
>> screen) of the PictureBox
>>
>> I tried to use the BitBlt, but only got the visible part of the
>> PictureBox.
>>
>> I am wondering if it is correct if I use the PictureBox1.hDC as
>> the source bitmap handle for the Blitting.
>>
>> Or, may I just use the vbSrcCopy as the last parameter for the
>> BitBlt function?
>>
>> Thanks
>>
>> George
>>
>> "Ren Whitworth" <R.Whitworth@w-s-s.de> wrote:
>> >If you want to print EXACTLY what you see on the screen then why don't
>you
>> >BitBlt() the screen area which is inside the PictureBox to the PictureBox
>> >and then Printer.PaintPicture the PictureBox.Image?
>> >
>> >--
>> >Hope this helps ...
>> >
>> >Rene Whitworth
>> >Whitworth Software Solutions - Germany
>> >http://www.w-s-s.de/Developer
>> >Please reply to the newsgroup :-)
>> >
>>
>>
>
>
George at 2007-11-11 20:11:18 >