pixmap window
BlitzMax Forums/BlitzMax Programming/pixmap window
| ||
Hi, I was under the impression pixmap window cut a chunk out and made a new pixmap. I am creating images. The original pixmap is then destroyed. However weird errors occur: http://www.blitzmax.com/Community/posts.php?topic=60220 |
| ||
No the docs state a virtual pixmap is created, use mypixmap.Window(x,y,w,h).Copy() if you want to copy a region of the orginal. |
| ||
A window is a pixmap `header` that points to an existing block of memory in another pixmap object. One pixmap of data is then shared between both pixmaps. It's like defining a viewport in a pixmap. |
| ||
Hi, PixmapWindow just returns a 'virtual' window into a pixmap - it doesn't do anything clever beyond that, ie: if the main pixmap is released and you try to use the window you're hosed. |
| ||
Thanks guys! If I create an image using LoadImage(pixmap) and destroy the original pixmap, is this safe? |
| ||
Yes as the Image will maintain an own pixmap if needed. |
| ||
What do you mean by destroy??? In it's current state, I don't think pixmap windows can safely be used with LoadImage. |
| ||
Doesn't LoadImage create a copy of the Pixmap??? (I thought it does as my entity system does not break and it uses loadPixmap on a local pixmap instance everywhere it loads anything ... and the images created from that don't break ... I would consider it a serious bug if the TImage fails just because of the object that was used to LoadImage does not exist anymore) |