Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Yuri Rubinov
  Where is Yuri Rubinov?
 Philadelphia
 Pennsylvania - United States
 Yuri Rubinov
 To: Kulwant Singh
  Where is Kulwant Singh?
 Shimla
 India
 Kulwant Singh
 Tags
Subject: RE: Fractions of Pixels
Thread ID: 112443 Message ID: 112446 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Visual Basic
Date: Wednesday, November 08, 2006 5:12:09 PM         
   


> Hello Experts,
>
> I have a another PROBLEM. I need your help.
>
> I created a progress bar with 2 shapes on a form. The outer shape1 has a width of 400. The Inner shape2 starts with 0. There are 239 records in a table. I calculate the incremental value with this formula :
> mDONE = 400 / RECCOUNT() which in this case works out to 400/239 = 1.6736.
>
> then i use:
> SELE mFILE
> GO TOP
> DO WHILE NOT EOF()
> thisform.shape2.width = thisform.shape2.width + mDONE
> SKIP
> ENDDO
>
> My Problem.
> When I run the form the inner shape2 ends up halfway within the outer shape1. It is not covering the full length of 400. With (1.6736 * 239) it should end up at 400.
>
> If i use CEILING(mDONE) the length will exceed 400 AND overshoot the outer shape1.
>
>
> With FPW the above formula worked because the unit of calculation was 'columns'. How do i make it work with pixels in VFP.
>
> Another very important question:- Where should this code reside? I have put it in the 'init' proceedure of the form
>
>
> Thanks!
> kulwant


Hi,

First I believe that reccount() is not appropriate here because it counts deleted records too.

Secondly, you cannot managed to show graphics with fractions of pixel precision. Also, 1.6736 * 239 # 400, but 399.9904.

And the last, but not least, show the increment in portions, say 5% of the shape1.width.

Best Wishes,

Yuri Rubinov

ENTIRE THREAD

Fractions of Pixels Posted by kulwant singh @ 11/8/2006 4:37:25 PM
RE: Fractions of Pixels Posted by Ken Murphy @ 11/8/2006 4:59:15 PM
RE: Fractions of Pixels Posted by Bernard Bout @ 11/9/2006 7:12:24 AM
RE: Fractions of Pixels Posted by Ken Murphy @ 11/9/2006 8:24:06 AM
RE: Fractions of Pixels Posted by Bernard Bout @ 11/10/2006 7:45:48 AM
RE: Fractions of Pixels Posted by Ken Murphy @ 11/10/2006 11:59:55 AM
RE: Fractions of Pixels Posted by Bernard Bout @ 11/10/2006 10:23:33 PM
RE: Fractions of Pixels Posted by Ken Murphy @ 11/11/2006 2:03:23 AM
RE: Fractions of Pixels Posted by Bernard Bout @ 11/12/2006 3:27:30 AM
RE: Fractions of Pixels Posted by Yuri Rubinov @ 11/8/2006 5:12:09 PM
RE: Fractions of Pixels Posted by Carlos Alloatti @ 11/8/2006 8:32:52 PM