>> PIC.AutoRedraw=true
>> ...draw something to PIC like PIC.Line (...)-(...)
[quoted text clipped - 10 lines]
> pictureBox - right ?
> Try using PIC.Image instead.
Hmm, thank you for your answer.
With .image it works perfectly.
Of course, in a picturebox there is also .picture available
but only as sub-object with its properties .Handle, .height,
ans so on, but not including an image property, so there was
no error generated. Maybe pictureboxes didn't have this
object in VB5, I could swear that I referred to the image
content by .picture some years ago. Nevertheless, thank you.
Hmm, it works witth Clipboard.SetData PIC.Image,vbCFBitmap
without paranthesis - what should they be for?
senn - 28 May 2008 17:07 GMT
>>> PIC.AutoRedraw=true
>>> ...draw something to PIC like PIC.Line (...)-(...)
[quoted text clipped - 21 lines]
> Hmm, it works witth Clipboard.SetData PIC.Image,vbCFBitmap without
> paranthesis - what should they be for?
Good, you got it working. I' m also using VB5
and don't know if any difference to VB6. The
picture and image properties are related to
different layers.
Though, as you use the image property setting
some drawing to the Clipboard, you're using
the picture property to set the drawing back
to the picturebox. Look an example below,
that uses two pictureboxes on a form. It draws
a circle on picture1, sets it on the clipboard, then
clears the pictureboxes and puts the circle back
on both pictureboxes.
As you found out, you don't necessarily have to use the
parenthesis. -VB5 Books on Line tell one to
use these - but don't tell why.
You should look at
microsoft.public.vb.general.discussion
about a 20 lines down from top you'll find
the subject line: Picture this
Read Larrys answer and use the site he pointed
to.
/senn
Option Explicit
Private Sub Form_Load()
Picture1.AutoRedraw = True
Picture2.AutoRedraw = True
Picture1.Circle (2000, 1600), 1000
Clipboard.Clear
Clipboard.SetData Picture1.Image, (vbCFBitmap)
'Or one of the two below works as well
'Clipboard.SetData Picture1.Image, vbCFBitmap
'Clipboard.SetData Picture1.Image
Picture1.Cls
Picture2.Cls
Picture1.Picture = Clipboard.GetData
Picture2.Picture = Clipboard.GetData
End Sub
Lorin - 07 Jun 2008 16:52 GMT
() means value of. i.e. passing a value not a pointer (ByRef)
>>>> PIC.AutoRedraw=true
>>>> ...draw something to PIC like PIC.Line (...)-(...)
[quoted text clipped - 65 lines]
> Picture2.Picture = Clipboard.GetData
> End Sub