How can I display an image?

Right now I'm trying to display a basic, completely white bitmap - but I can't seem to get anything to happen at all. Here's my code:

Scene_Map.prototype.showPicture = function() { this._bitmap = new Bitmap(200, 200); this._bitmap.fillAll(#FFFFFF); this._sprite = new Sprite(this._bitmap); this.addChild(this._sprite);};The idea is that this creates a bitmap, fills it with white, assigns it to a sprite, and then puts the sprite in the rendering pipeline. Unfortunately, it doesn't work at all. It doesn't throw any errors, and a quick console.log("executed") tells me that the code IS being run. What am I missing?
Sprites have bitmaps attached.  So try something like this:

Scene_Map.prototype.showPicture = function() { this._sprite = new Sprite_Base(); this._sprite.bitmap = new Bitmap(200, 200); this._sprite.bitmap.fillAll(#FFFFFF); this.addChild(this._sprite);};If you get stuck I added pictures to bitmaps and attached them to sprite here, if you want something working for reference:

http://forums.rpgmakerweb.com/index.php?/topic/46926-nasty-replace-window-with-picture/
Oh great, thanks! So I should call bitmap as a function of sprite instead of as an argument of Sprite(). It turns out that my fillAll code was wrong too, but after I looked at your script I was able to display an image with no problem (brilliant idea with that script btw, I will definitely be using it in my games). Thanks!
I'm not seeing it over here.  I've tried a couple of variations and still none of them work - though the lines are being executed.

In a plugin script I have:

(Scene_Map.prototype.showPicture = function(){ console.log("I was run!"); this._sprite = new Sprite_Base(); this._sprite.bitmap = new Bitmap(1920,1080); this._sprite.bitmap = ImageManager.loadPicture("digital-assist"); this._sprite.addChild(this._sprite); console.log("I grabbed an image file!");})();It seems nearly identical to what's been posted (minus the this.addChild as it complains 'undefined is not a fucntion') and yet no image is displayed.  What am I missing here?
Okay, so I hacked away at this for awhile and learned some weird stuff. Did you copy-paste the code from the site? Because when I copy-pasted your code, it didn't work for me either. But when I typed it in directly, it did work, with the following modifications.

The self-executing anonymous function doesn't seem to work for displaying images. I don't know why. To get the image to show up, I just dropped a line in createDisplayObjects.

Scene_Map.prototype.createDisplayObjects = function() { this.createSpriteset(); this.createMapNameWindow(); this.createWindowLayer(); this.createAllWindows(); this.showPicture();};Obviously this should be aliased in instead - I was in a hurry. Also, I think the "new Bitmap" line is redundant because a sprite can only have one bitmap. Defining it twice is like saying "var x = 0; var x = 1" in that the second value just overwrites the first. Hope this helps!
Still not working over here even when I manually retyped it.  Are my line-endings/encoding in a bad format or something?  I'm on UTF-8 and Windows EOL.

Code:
(Scene_Map.prototype.showPicture = function(){	console.log("I was run!");	this._sprite = new Sprite_Base();	this._sprite.bitmap = ImageManager.loadPicture("digital-assist");})(); Scene_Map.prototype.createDisplayObjects = function() {	this.createSpriteset();	this.createMapNameWindow();	this.createWindowLayer();	this.createAllWindows();	this.showPicture();}
That was the first thing I checked. Visually, I can't find any problems. I don't know exactly why copy-pasting would create this issue. I do see two things that might be causing your problem though. First, you still need the addChild line - I believe that's what puts the sprite into the rendering pipeline, so there's no way it'll be displayed without that. Second, you still have your code wrapped in the self-executing anonymous function. That might also somehow interfere. Idk if it will prevent it from working when you've directly told createDisplayObjects to execute it, but it might. If it's not either of those, then I'm out of ideas. Hope this helps.

EDIT: Actually, I have one remaining trick. Start a new project. Drop the below file in the plugins folder and change its extension from .txt to .js. Activate it in the plugin manager and put your picture in the img/pictures folder. This works perfectly on my computer. If it doesn't work for you then I've got no idea (for serious this time).

test.txt

Original thread: https://forums.rpgmakerweb.com/threads/how-can-i-display-an-image.47060/