Results 1 to 6 of 6

Thread: Centering an image

  1. #1

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Post

    Let us say that I have a 40 * 40 graphics with whatever extenstion-- say gif--

    How do I reduce the size of that image and then put that in a picture box so that the properties of the picture box don't change, it is the actuall which changes its height and width when loading from the file.
    Did you get that?
    Baaaaaaaaah

  2. #2
    New Member
    Join Date
    Apr 2001
    Posts
    11
    i'm not sure if this is what u mean, but don't u just set the picture box's Stretch attribute to True?

  3. #3

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Angry But

    Yes but I want the picture box of the size 16 by 16 - neither more
    nor less. That is problem.
    Baaaaaaaaah

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Okay, then use the StretchBlt API!!!

    (trumpet sounds )

    It's a 'sister' API to Bitblt, and it works well with no memory leaks. Give it a try.

    PS >
    Pictureboxes dont support stretch ...
    only imageboxes!
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  5. #5

    Thread Starter
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    What are these parameters?

    Ok then what should this be equal to in that "stretchblt" API:

    dwrop as long

    I used this:

    StretchBlt Picture2.hdc, 0, 0, 10, 10, Picture1.hdc, 0, 0, 10, 10, 0

    Picture1 has a picture in it!

    It just draws a small black box in picture2.
    What is the problem?
    Baaaaaaaaah

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    stands for dword raster operation, a code that determines how the blitting is performed, use vbsrccopyconstant as default
    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.

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