Page 1 of 1

GetTexture with a 100 dpi tif

Posted: Wed May 09, 2007 7:40 pm
by Loki
I have a .tif file that is a 16 bit 100 dpi image that I want to use as a background and then draw on top of it. I've tried using all the DriverTypes, and even a 100dpi jpg and it says "Could not create vertex shader" and then "could not load texture: image.tif"

If I save the tif as a bmp in paint it changes the dpi to 96 dpi and trhows everything off. (I am trying to draw over very specific pixels)

This tiff also will not load with GDI, but it will load just fine using Windows Presentation Foundation. The 100 dpi jpg, however, does load in GDI. Both solution so far are just too slow and I wanted to see if Irrlicht could handle it (we are drawing some 100,000 lines to the screen).

If anyone has an idea on how I can get it to work, your help would be much appreciated.

and FYI, it takes irrlicht about 1-2 seconds to draw the same data that WPF takes about 5-10 seconds to draw.

so far I'm using the 2D example.

//set the driver type
DriverType driverType = DriverType.DIRECT3D8;

// Create device and exit if creation fails:
device = new IrrlichtDevice(driverType, new Dimension2D(1024, 768), 32, false, true, true);
if (device == null)
{
throw new Exception("Device creation failed.");
}

/*
Get a pointer to the video driver and the SceneManager so that
we do not always have to write device.VideoDriver()
*/
IVideoDriver driver = device.VideoDriver;

//load the image as a texture
ITexture images = driver.GetTexture(imageFileName);


...

while (device.Run() && driver != null)
{
if (device.WindowActive)
{
uint time = device.Timer.Time;
driver.BeginScene(true, true, new Color(0, 120, 102, 136));

driver.Draw2DImage(images, new Position2D(0, 0));

...

Posted: Wed May 09, 2007 9:50 pm
by hybrid
.tif is unsupported. However, using a specific dpi to correctly draw to some pixels will not really work. Your screen will have varying dpis depending on screen size and resolution. And the mapping to 3d coordinates will probably make the matching completely impossible.
Maybe describe what you want to achieve and some better ideas can be proposed.