Results 1 to 4 of 4

Thread: finding pixels in an image

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 1999
    Location
    Rochester NY, USA
    Posts
    93
    As a little expierement, I want to do some calculations on pixles in an image. How do I get the number of pixles in X and Y directions... so I can create a table of the same size.. thanks..

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    What scales are you using? To convert between pixels and twips use twipsperpixelx and twipsperpixely
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Frenzied Member
    Join Date
    Jul 1999
    Location
    Huntingdon Valley, PA 19006
    Posts
    1,151

    screen Resolution

    I am using VB6 & Windows 98, Second Edition. I have Visual Studio installed on my System.

    The following resulted in values like (640 & 480), (800 & 600), (1024 & 768), et cetera.
    Code:
    Dim PixelsX As Integer
    Dim PixelsY As Integer
    
    PixelsX = Screen.Width / Screen.TwipsPerPixelX
    PixelsY = Screen.Height / Screen.TwipsPerPixelYl
    I have been experimenting with resizing Forms & Picture Boxes when Screen Resolution changes. The above worked for me. I do not think it is necessary, but my form had a Sysinfo Control (Try adding one, if the above does not work for you).

    Some of the data from the system is still confusing to me. For example: Form Width & Height seem to be measured in "Logical" Twips (No change when Screen Resolution changes, and the size of the Form has obviously changed). Screen Width & Height seem to be measured in Absolute Twips, changing when Screen Resolution changes. Note that WorkArea Width & Height take the size of the Task Bar into account.

    The VB documentation has often omitted some crucial data, so I advise experimenting.

    Live long & prosper.

    The Dinosaur from prehistoric era prior to computers.

    Eschew obfuscation!
    If a billion people believe a foolish idea, it is still a foolish idea!
    VB.net 2010 Express
    64Bit & 32Bit Windows 7 & Windows XP. I run 4 operating systems on a single PC.

  4. #4
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    If you mean the size like you get it from the iPictureDisp object you have to scale them by form:

    Code:
    x = Form1.ScaleX( Form1.Picture.Width )
    y = Form1.ScaleY( Form1.Picture.Height )

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width