Re: Floating point coordinates
On 1 May 2006 18:31:10 -0700, ataanis@xxxxxxxxx wrote:
While I was trying to create an event using mouse Up and down, I
realized that the return values of those (in term of coordinates),
return only integer numbers, is there a way to get the actual whole
number (e.g : with the decimal part?)
For a Form or Picbox you would need to use a ScaleMode that is not
integer-based (iow something other than Twips or Pixels). Controls
with no ScaleMode property generally use Twips. Pixel is really the
limit for mouse coords. They can be mapped to other scalemodes, but
the precision is still 1 pixel. That's why for example an X position
in twips is always an exact multiple of Screen.TwipsPerPixelX.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
.
Relevant Pages
- Re: button size problem
... twips or pixel, set the width and height of the form, and make sure ... ScaleMode (for example twips, pixels, inches or whataver). ... Command1.Left = Me.ScaleX(0.5, vbInches, Me.ScaleMode) ... (comp.lang.basic.visual.misc) - Re: Picture in image control gets cliped "Sometimes" does not stay
... the width of the picture in the Image control. ... per logical inch (the equivalent of 15 twips per pixel) whereas others run ... exactly the same "twip size" as the design time twip size client area on ... (microsoft.public.vb.general.discussion) - Re: Picture in image control gets cliped "Sometimes" does not stay flu
... the width of the picture in the Image control. ... This will almost certainly be because your code is not properly taking into acount the differences in the Windows dots per inch (or twips per pixel) setting on different machines. ... The only time it will fail to do this is if the pixel size of the display on which your code is running is not sufficient to display such a Form, in which case it will make the client area as large as it can under the circumstances. ... (microsoft.public.vb.general.discussion) - Re: How do I get my app to look correct at different dpi settings?
... any control that has a scalemode and HDC property. ... That's because VB always records the design time size of the client area of the Form and the design time size and position of all Controls using twips, regardless of the ScaleModes you happen to be using. ... At runtime the compiled exe examines those twip values and converts them to pixels in accordance with the dpi setting of the machine on which the exe is currently running. ... Then it attempts to create a Form of such an overall size that its client area is the pixel size it has just calculated, taking into account the various Form border thicknesses on that specific machine when working out what the overall Width and Height of such a Form needs to be. ... (microsoft.public.vb.general.discussion) - Re: form size suddenly not correct
... > I recently updated my ATI Radeon 9200 video driver and ... your Forms to always be a fixed pixel size I ... stores the desired size using Twips as the unit of measurement (both in your ... ..frm files and in your compiled exe file), and it do so regardless of the ... (comp.lang.basic.visual.misc) |
|