Why is LoadImage returning null?

BlitzMax Forums/BlitzMax Programming/Why is LoadImage returning null?

Pineapple(Posted 2014) [#1]
When I start the code off with this, attempting to load a PNG image returns null:

Framework brl.max2d
Import brl.d3d9max2d
Import brl.pngloader


When I don't, the PNG loads fine. What am I missing?


GfK(Posted 2014) [#2]
Brl.graphics?

on my phone at mo so cant check for sure


dan_upright(Posted 2014) [#3]
The following code gives me a row of 3 images, what are you doing differently?
SuperStrict

Framework brl.max2d
Import brl.d3d9max2d
Import brl.pngloader

Local image:TImage, pixmap:TPixmap

Graphics 800, 600

image = LoadImage("smile.png")
DrawImage(image, 0, 0)

pixmap = LoadPixmap("smile.png")
DrawPixmap(pixmap, 64, 0)

image = LoadImage(pixmap)
DrawImage(image, 128, 0)

Flip
WaitKey()

Brl.graphics?

It's imported by brl.d3d9max2d.


Pineapple(Posted 2014) [#4]
Strange, that works fine for me. I'm using a file included with Incbin, could it be a product of that?


dan_upright(Posted 2014) [#5]
Give me a minute to check.

Edit: Quick thought, are you putting "incbin::" before the filename?


dan_upright(Posted 2014) [#6]
Found it, add:
Import brl.ramstream

And it should be golden mate.


Pineapple(Posted 2014) [#7]
That's done it. Thanks much!


TomToad(Posted 2014) [#8]
You could use Framework Assistant. It will tell you what you need to import.