I am wondering if there is some 'easy' way to accomplish this. Reading through the documentation suggests the best method may be to load one BMP object, then based off the width and height of the first, create a second empty object, and copy all the pixels over in a loop taking into account the left/right 'margin' offset. However, I was curious if there was some other way built in to the library to accomplish this... It sounds as if simply changing the size of the 'canvas' (via 'SetSize') will erase any present image data. Further, pre-loading the image, finding the size, and then doing 'SetSize' before reloading would at most give one only a right, rather than a left offset.
If the 'copy' procedure described is the best method, I will just go with that, but thought I might ask. Thanks so much for the work on this library ! It is really a great resource.
Hello, and thanks for your email and interest in EasyBMP!
If we had used more "modern" data structures when writing EasyBMP (using STL container functions like vector<Pixel>), it would have been easier to extend the array without recopying. It would probably be a great code refactor in the future!
But alas, for now, the way you mentioned (create a new BMP object of the correct size and copy the pixels over) is the only way to accomplish this.
Thanks -- Paul