Post

 Resources 

Console

Home | Profile | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 VBGamer
 VBGamer
 One last DirectX issue - resolutions + TL vertices
 New Topic  Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

EACam
Warrior

154 Posts

Posted - May 12 2004 :  2:43:32 PM  Show Profile  Reply with Quote
No...don't give up...just use a different solution

Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 12 2004 :  5:56:39 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
This image demonstrates lines being deleted when an image is resized. A good way to see line deletion in action is to quickly create a project in VB, place an IMAGE, not a picture box, on the form in the top left corner, then put image1.height = y : image1.width = x in the form's Mouse Move event. You should be able to move the mouse and interactively change the size of the image and whatch what happens when the image gets bigger and smaller than its original size.

Go to Top of Page

Peter
Administrator

Canada
67 Posts

Posted - May 13 2004 :  1:16:41 PM  Show Profile  Visit Peter's Homepage  Reply with Quote
Yeah, I've run into this problem before too. Try turning off texture blending when you're resizing the buttons, that fixed it for me, although my borders were a little thicker.

Talos Studios - VoodooVB - VB Gamer

Go to Top of Page

Almar
Moderator

Netherlands
192 Posts

Posted - May 15 2004 :  03:08:59 AM  Show Profile  Visit Almar's Homepage  Send Almar an ICQ Message  Reply with Quote
Well, still haven't solved it... But the problem still seams to be a bit related t orounding as well..

sngY = (Int(sngY) * constTileSize) \ 1
sngWidth = (sngWidth * constTileSize) \ 1

gives the exit button a "bottom-top", but without, it doesn't.. (Just trying everything that comes to mind)
Go to Top of Page

Eric Coleman
Gladiator

USA
811 Posts

Posted - May 15 2004 :  6:53:17 PM  Show Profile  Visit Eric Coleman's Homepage  Reply with Quote
This this instead... sngY = Int(sngY + 0.5) * ConstTileSize.

Cint is for explicitly specifying the DATA TYPE of a number. The following statements are equivalent, MyNum = 23& : MyNum = CLng(23). Normally VB will use the smallest data type to store a number. The statement MyNum = 23 is really telling VB that the number '23' is either a BYTE or an INTEGER data type, but when the program is run it has to be converted to a LONG data type to fit in the variable MyNum. By explicitly specifying that the number 23 should be used as a LONG number, you save VB from doing an implicit data type conversion.

If you want to take a fractional number, for example, 3.14159 and trim the fractional part, 0.14159, then you would use either Int or Fix. Neither of those functions change the DATA TYPE of the number. For example, if you Dim S as Single: S = 3.14159 : S = INT(S), then NO data type converion is done. The INT and FIX functions are overloaded. Whatever data type you pass IN the function, you get the same thing OUT of the function. Of course, this only works with number data.

INT and FIX only truncate the fractional part of a number. If you want to round a fractional number to the nearest whole number, you can either use the ROUND function, or you can add 0.5 to the number before using INT or FIX. 1.5 should be rounded to 2 by normal mathematical rules. To get a correct answer, use INT(1.5 + 0.5). If you add 0.5 to the number before using INT, then this will work for negative nubmers as well, so you wouldn't need to use FIX. Also, this method doesn't have the same rounding errors as ROUND or CINT will cause.
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
VBGamer © Go To Top Of Page
This page was generated in 0.11 seconds. Snitz Forums 2000

Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.