Bitmap.blt - combining bitmaps

I want to combine several bitmaps together (I am making a paperdoll system).

I can't get Bitmap.blt to do anything though.

This is my code:
 

hair_bitmap = this.loadBitmap('img/hair/', hair, hue, false); body_bitmap = this.loadBitmap('img/bases/', body, hue, false); bmp = new Bitmap(body_bitmap.width, body_bitmap.height); bmp.blt(body_bitmap, 0, 0, body_bitmap.width, body_bitmap.height, 0, 0); bmp.blt(hair_bitmap, 0, 0, body_bitmap.width, body_bitmap.height, 0, 0);If I use hair_bitmap or body_bitmap individually, I get their graphic.

If I use bmp I get nothing at all.

If I run blt on hair_bitmap or body_bitmap, I just get their original bitmap (so blt is doing seemingly nothing).

I am guessing I have got the blt function wrong:

> bmp.blt(hair_bitmap, 0, 0, body_bitmap.width, body_bitmap.height, 0, 0);

Any ideas where I am going wrong?
Hey ♫

I was running into this problem yesterday, I believe the issue that when you call load_bitmap it begins to load the image, but by the time it gets to the blt call it hasn't actually finished loading the image into the cache. 
Try calling the load_bitmap earlier in the script, ideally as early as you know for sure you are going to need that image. (You don't need to do anything with those images, simply calling load_bitmap will put the image into the game's cache, making all future calls work)

I hope this helps

/Kai 
Ah. That could pose problems for me...

Is there an easy way of testing if it's been loaded yet?
Hey ♫

The bitmap does have a "load listener" array attached to it, but I couldn't figure out a reliable way to tell it either "Has this loaded" nor "Wait for this to load". 

Sorry for non-answer, other than try and cache as early as you can

/Kai
yea it's not reliable to load on the fly, like during window creation. so you have to load all images at the beginning, which means bloating the cache, leading to poor memory management and out of memory errors.
Trouble is, as it's a paperdoll system I'm making, I'd hope to have hundreds of images. I can't just load everything at the start realistically.

I'm going to have to think of a different way to go about this.

Original thread: https://forums.rpgmakerweb.com/threads/bitmap-blt-combining-bitmaps.49811/