Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » Rescale and copy area of source image into an area of dest image
Re: Rescale and copy area of source image into an area of dest image [message #14554 is a reply to message #14547] |
Mon, 03 March 2008 17:52 |
mdelfede
Messages: 1307 Registered: September 2007
|
Ultimate Contributor |
|
|
well, partly solved... the bug was not here... for others interested in using Image and Imagebuffer, beware :
ImageBuffer buf;
Draw d = ........
...........
...........
d.DrawImage(buf, .....)
will *not* work, or better, it'll work ONCE.
DrawImage expects an Image& parameter, so buf is converted on the fly onto Image object, loosing its content due to destroy-on-copy behaviour.
The correct code is :
ImageBuffer buf;
Draw d = ........
...........
...........
Image img = buf;
d.DrawImage(img, .....)
buf = img;
quite un-intuitive, indeed. It would be much better to have a different version of DrawImage with an ImageBuffer & as first parameter. Also, allowing such automatic type conversion on objects that have the destroy-on-copy semantics can lead to subtle bugs...
Ciao
Max
|
|
|
Goto Forum:
Current Time: Wed May 29 05:32:30 CEST 2024
Total time taken to generate the page: 0.02149 seconds
|