That 3rd vector has been my bugaboo all along. When I don’t use it, I get a graphics parameter. I’ll try again.
I’m having some success with your suggestions. For a canvas, this works. Thanks. But still very unclear how to move all this into a Picture.
OK… we need the whole example.
Create a window, add a picture property called ThePicture
Add a Canvas
In the window Open event, do this:
In the Canvas’ Paint event, do this:
Run it, and you will see this:
and an EMF file will be on the desktop.
That works. Thank you. What I was unable to see was how to use the “Objects” property. Maybe this is in the docs but I sure could never find it.
Again, I do appreciate the personal help. Softened a miserable evening after watching my fav bb team, Purdue, go down in flames to a #16 seed.
I will now go about rewriting code to get my original purpose accomplished: two puzzles on one page.
Original example:
Var o As New OvalShape
o.Width = 60
o.Height = 120
o.FillColor = RGB(127, 127, 255)
g.DrawObject(o, o.Width, o.Height)
You put that example in the Paint Event of a Canvas…
Now, the reworked example:
Var VectorPict As New Picture(300,300,0)
Var o As New OvalShape
o.Width = 60
o.Height = 120
o.FillColor = RGB(127, 127, 255)
VectorPict.Objects.AddObject(o)
cVector.Backdrop = VectorPict
cVector is a Canvas I placed in Window1.
The code is located in Window1.Open.
Is it clear now ?
What you may have missed is Objects
; look carefully the line:
VectorPict.Objects.AddObject(o)
vs what the doc says:
g.DrawObject(o, o.Width, o.Height)
Is it clear now ?
PS: now, you have an object (the Picture I called VectorPict) you can use to draw on screen (as seen above) or print, or save, or… whatever.
Jeff beats me on that. I read back the whole thread and notice that right now.
Yes, this is precisely why the docs failed me. They kept using the g graphics of a canvas to illustrate never explaining — at least not anywhere I could find — how to use Objects in a vector-picture.
Thanks for clarifying.
Also, Emile solved it as well with a slightly different take. Both were very helpful.