473,394 Members | 1,699 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Since when does 320.0 * 0.629 = 652!?

RatioX is 2.018 (verified)
RatioY is 0.6291 (verified)

Therefore Ratio becomes 0.6291 (verified)

BUT! When I trace through the calc, BigPicture.Width becomes 625! Did I
make a huge mistake here? I can't see it

' Now find ratio of width and height to 320 x 240

Dim RatioX As Single = CType((sWidth / 320.0F), Single)
Dim RatioY As Single = CType((sHeight / 240.0F), Single)
Dim Ratio As Single = Math.Min(RatioX, RatioY)

' Set the width and height of the big picture

BigPicture.Width = CType((Ratio * 320.0F), Integer)
BigPicture.Height = CType((Ratio * 240.0F), Integer)
Nov 20 '05 #1
1 828
Oh hell, I got it. I'm dock.fill - which means when I set the property, it
automatically sets it back to the full width. Doh!

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bv*******************@news.demon.co.uk...
RatioX is 2.018 (verified)
RatioY is 0.6291 (verified)

Therefore Ratio becomes 0.6291 (verified)

BUT! When I trace through the calc, BigPicture.Width becomes 625! Did I
make a huge mistake here? I can't see it

' Now find ratio of width and height to 320 x 240

Dim RatioX As Single = CType((sWidth / 320.0F), Single)
Dim RatioY As Single = CType((sHeight / 240.0F), Single)
Dim Ratio As Single = Math.Min(RatioX, RatioY)

' Set the width and height of the big picture

BigPicture.Width = CType((Ratio * 320.0F), Integer)
BigPicture.Height = CType((Ratio * 240.0F), Integer)

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Ali | last post by:
I did the folloing in python shell: >>> x = 5.07e-25 >>> x = long(x) >>> print x 0L Um... I was under the impresion that long numbers had very very long precision. But, it seems that in...
4
by: OJ | last post by:
Hi, This works to maximize the window, but wants to load yahoo locally : C:\WINDOWS\Desktop\www.yahoo.com <html> <script type="text/javaScript"> <!-- function test() { qwe =...
5
by: Ken | last post by:
Hello Everyone, I think that there is no way to add a network printer in .Net. I have tried ,as an alternative, using windows API AddPrinter. This was not successful. Does anybody have a...
6
by: Andrew Mueller | last post by:
Hello all, There is a message below 'Application Error... When querying data'. What appears to be happening is that when I perform a lot of queries in a row and bring back the information into...
102
by: hug | last post by:
www.webmaster, was suggested that this ng could be a better place.] I've updated my test server to handle if-modified-since. I've noticed that the (old copies I run of) IE and Netscape seem...
14
by: FMDeveloper | last post by:
Currently transitioning from a shared host to a dedicated server. The same code that works on the old server is not working on the dedicated server. It is a simple AJAX request like: <code>...
23
by: nsa.usa | last post by:
Hi, I used to use a function in other languages (TP or asm don't remember) where I could get number of clockticks since 1980. Is there a similar function in C? I don't seem to find it. I need...
15
by: =?Utf-8?B?U2ltb24=?= | last post by:
Hi I am trying to read the html header 'if modified since' by using Request.ServerVariables("HTTP_IF_MODIFIED_SINCE") in classic ASP. But I am unable to get anything from this, this variable is...
4
by: MrDeej | last post by:
Hello! I have a complex .accdb database which i after yesterdays changes cannot enter the VBA anymore. Most of the forms and all tables/queries works fine. But one of the forms causes it to hang...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.