Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Resize/Crop a bitmap image in C++

Options
  • 17-01-2004 12:20am
    #1
    Closed Accounts Posts: 223 ✭✭


    Does anyone know how to resize or crop a bitmap image?. Also each time i read an image into my program, if the width of the image is not divisible by 4 the pixel data gets messed up. Does any one know why?


Comments

  • Closed Accounts Posts: 437 ✭✭casper-


    I'm assuming you're talking about BMP files; welcome to their weird and 'wonderful' world :)

    1a) resize - there are several ways of doing this; you'd need to decide what your goals are first

    1b) crop - pretty straightforward, just read the part of the data you want into a new array

    2) if it's not divisible by four you may need to pad out the extra bytes and then continue

    There's tons of information on this on google ....


  • Closed Accounts Posts: 3 motyl


    don't know why you bother doying editing yourself!
    well, i'd understand if you need to write pretty fast game engine or so ....

    the best you can do is to find out WHAT EXACTLY you need now and will need in the future (editing-wise) and then search web for components that can do it. there's looooooooadz of them for free.

    the best i've used so far was Pegasus ImageXPress


Advertisement