Results 1 to 10 of 10

Thread: Rescaling bitmaps

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200

    Unhappy Rescaling bitmaps

    Here's my question. How do you rescale bitmaps?

    ...and I don't mean using the PaintPicture or StretchBlt API.

    e.g. I created a bitmap (used for memory DC) whose size is 320 x 240 pixels. Now how can I rescale (resize, expand...call it whatever you like) it to, for eg., 640 x 480 pixels?
    The only solution I've come around so far is to create a new bitmap and delete the old one... but I know there has to be another way.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    If you want not to lose quality then you can go to
    http://vbden.tripod.com/download.htm

    Where I have made my own enhancer for gfx...
    And I have a DLL version on the go (uses DDraw) that you can use at runtime...

    just email me
    [email protected]
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    Actually, the bitmap is empty (created with the CreateCompatibleBitmap API).

    Hm, just realized I've used the wrong word for the title

    I need to change the bitmap's width/height. You know, exactly the same as when you change the height/width properties of a PictureBox and the "drawing area" expands...

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Then why don't you do that?
    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
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    The reason is simple. I can't

    I tried using the SetBitmapDimensionEx API but the system doesn't use these dimensions when blitting onto a DC. And as for the PixtureBox, I'm trying to use as less controls as possible...

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Youre so right, you can't, simply because a a bitmap is a bit-map, a singledimensioned array of bits. What you have to do is create a new bitmap and blit over.
    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.

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    I thought so...bummer...

  8. #8
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    Whacha doin'?
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Aug 2000
    Location
    Croatia
    Posts
    200
    I'm creating a program for designing labels, covers, etc.

  10. #10
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    In my DLL I'll have some easy-DX stuff, allowing you do change pixels on a DDraw(DX7) surface using a LONG array of x,y, instead of what DD gives you....
    All contents of the above post that aren't somebody elses are mine, not the property of some media corporation.
    (Just a heads-up)

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