Resizing a Shape control  
Author Message
UneTernal





PostPosted: Fri Jan 02 06:19:33 CST 2004 Top

Visual Basic >> Resizing a Shape control

I use this code for a circle shape (black color)

Private Sub Command1_Click()

Shape1.Height = 10
Shape1.Visible = True
For n = Shape1.Height To Form1.ScaleHeight / 2
Shape1.Height = n
Shape1.Width = Shape1.Height
Next

but I see very small white lines...
What can I do to desappear the white lines that I see
at the resizing of the shape ?
I dont want to use the Circle() function.

Visual Studio198  
 
 
Steven





PostPosted: Fri Jan 02 06:19:33 CST 2004 Top

Visual Basic >> Resizing a Shape control Set it's border to 0?

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)




> I use this code for a circle shape (black color)
>
> Private Sub Command1_Click()
>
> Shape1.Height = 10
> Shape1.Visible = True
> For n = Shape1.Height To Form1.ScaleHeight / 2
> Shape1.Height = n
> Shape1.Width = Shape1.Height
> Next
>
> but I see very small white lines...
> What can I do to desappear the white lines that I see
> at the resizing of the shape ?
> I dont want to use the Circle() function.
>
>


 
 
giannis





PostPosted: Fri Jan 02 08:59:04 CST 2004 Top

Visual Basic >> Resizing a Shape control
|| Set it's border to 0?

Yes I think that I had noborder...
Steven You tried this ?
Works ?
I used the Circle resolution (with autodraw=true
and fillcolor=0).


 
 
giannis





PostPosted: Fri Jan 02 10:54:41 CST 2004 Top

Visual Basic >> Resizing a Shape control When we set at the shape border=0 and autodraw=true,
again dont work :((

Only the Circle() approatch works



 
 
Rick





PostPosted: Fri Jan 02 11:11:39 CST 2004 Top

Visual Basic >> Resizing a Shape control > When we set at the shape border=0 and autodraw=true,
> again dont work :((
>
> Only the Circle() approatch works

The problem has something to do with not being in sync with the vertical
refresh rate of the monitor. I presume there is a subclassing solution to
this problem, but I'm sure it would be long and ugly. If you have a solution
that you like using the Circle command, why not start your routine by
placing a circle where the Shape is, then set the Shape's Visible property
to False, run a loop to draw the rest of the expanding circle using the
Circle command, enlarge the Shape to match that final size, set the Visible
property of the Shape to True and erase the circles you drew with the Circle
command?

Rick - MVP


 
 
giannis





PostPosted: Fri Jan 02 12:27:56 CST 2004 Top

Visual Basic >> Resizing a Shape control
|| If you have a solution that you like using the Circle
|| command, why not start your routine by ....

No Ok Rick with the Circle() solution I dont need
the shape.

|| and erase the circles you drew with the Circle command

In my case when I need to erase the Circle I place before
the For..Next the Form.Autodraw = False, then I draw the
circle and I use the Form.Refresh.
How can I erase the circle with the Circle() command ?
I dont understand how can do this....
You mean the DrawMode ?



 
 
Larry





PostPosted: Fri Jan 02 12:46:00 CST 2004 Top

Visual Basic >> Resizing a Shape control

> In my case when I need to erase the Circle I place before
> the For..Next the Form.Autodraw = False, then I draw the
> circle and I use the Form.Refresh.
> How can I erase the circle with the Circle() command ?
> I dont understand how can do this....

Why do you need to erase it? Why not just draw right on top
of it?

LFS



Private Sub Form_Load()
Dim size, wait

Show
DoEvents

ScaleMode = vbPixels
FillStyle = vbFSSolid
FillColor = Point(0, 0)

For size = 5 To 50
Circle (60, 60), size, vbBlack

wait = Timer + 0.02
Do While wait > Timer
DoEvents
Loop

Next

End Sub



 
 
giannis





PostPosted: Fri Jan 02 14:26:37 CST 2004 Top

Visual Basic >> Resizing a Shape control Thanks Larry, its a very nice-small example,
but:
1) sorry, i didnt mention - this circle that i draw
is on a picture box that have loaded an image
and thus i cant use it, and
2) i need a filled (black) circle.

The first way is the :
picture1.autodraw=false (before the circle) and
the picture1.refresh (to erase the circle)
and the second way is to save the Image of the
picturebox in a StdPicture object and recall this
when i need to erase the circle.

Is there any other way so erase this (filled) circle
without destroy this image ? The DrawMode dont help ?




 
 
giannis





PostPosted: Fri Jan 02 14:32:29 CST 2004 Top

Visual Basic >> Resizing a Shape control And I need to show all the resizing procedure
to the user (the circle begins from a point and
conclude (? gather ?grow) in a big circle.


 
 
Larry





PostPosted: Fri Jan 02 15:10:04 CST 2004 Top

Visual Basic >> Resizing a Shape control
> Thanks Larry, its a very nice-small example,
> but:
> 1) sorry, i didnt mention - this circle that i draw
> is on a picture box that have loaded an image
> and thus i cant use it, and

Change the ScaleMode, FillStyle, FillColor, and Circle to
work with the picturebox:

Picture1.ScaleMode = vbPixels
...


> 2) i need a filled (black) circle.

Change the FillColor to black:

Picture1.FillColor = vbBlack


There, the circle now grows on the picturebox....

LFS


 
 
giannis





PostPosted: Fri Jan 02 16:18:35 CST 2004 Top

Visual Basic >> Resizing a Shape control When i "delete" the circle dont erassed the image ?


 
 
Larry





PostPosted: Fri Jan 02 17:13:40 CST 2004 Top

Visual Basic >> Resizing a Shape control
> When i "delete" the circle dont erassed the image ?

Re-draw the image in that area to 'erassed' the circle...

LFS


 
 
giannis





PostPosted: Fri Jan 02 18:16:39 CST 2004 Top

Visual Basic >> Resizing a Shape control Yes Ok !!!
Thanx !!!