drawBitmpa not working

Hello, i'm using a DUE with a CTE35IPS, and I need to draw a fullsize bitmap.
I made the file in photoshop, save it in jpg, and converted trought the UTFT tool, on the webside.
as DUE tarjet.
Also I made some testing, with the examples, and them work, I had to subtitute the int for short, and it works.
But for some reason it doesn't draw.
For my image, it draws a weird bunch of pixels, (green, red, whit, wherever), and the rest of the screen in white.

any help, would be aprecciate.
Thx!

by the way, I dont know , and can't find what means the digits after the converted file, in this case [153600], and
if you can clear, how I should inlcude the .c file? as a short? as a int?.

#include <UTFT.h>
#include <avr/pgmspace.h>

UTFT myGLCD(CTE35IPS,25,26,27,28);

extern unsigned short craneologo1[153600];

void setup()
{
myGLCD.InitLCD(LANDSCAPE);
}

void loop()
{
myGLCD.fillScr(255, 255, 255);
myGLCD.drawBitmap (0, 0, 480, 320, craneologo1);

delay(5000);
myGLCD.fillScr(0,0,0);
delay(2000);
}

The .c file

craneologo1.c (1.44 MB)

[153600]

How much RAM has the Due got?

Sorry, but I pretty noob in all this stuff.
What do you mean? How can I know how many RAM is on DUE?,

You could look at the product spec on the Store page.

It says:

Flash Memory 512 KB all available for the user applications
SRAM 96 KB (two banks: 64KB and 32KB)

So, your 307200 byte array was going into 96kB of RAM.

AWOL:
So, your 307200 byte array was going into 96kB of RAM.

Assuming a DUE is being used,
RAM wouldn't be used for the actual data array since it was declared as const
and const won't be in RAM.

That said there are some things that don't add up.
The first post said it was a DUE, but yet the code is including
a header file <avr/pgmspace.h> which is a AVR specific header file.

--- bill

So, I resized the image, to 5760 bytes, and is still dont working.
I took out the <avr/pgmspace.h> line, and is still not working.

I have tried the examples that came in the UTFT library, and printing the info.c, tux.c, and the icon.c inluded it works.
I ony had to replace the unsigned int for unsigned short, and it works charming.

// UTFT_Bitmap (C)2012 Henning Karlsen
// web: http://www.henningkarlsen.com/electronics
//
// This program is a demo of the drawBitmap()-function.
//
// This demo was made to work on the 320x240 modules.
// Any other size displays may cause strange behaviour.
//
// This program requires the UTFT library.
//

#include <UTFT.h>
#include <avr/pgmspace.h>

// Declare which fonts we will be using
extern uint8_t SmallFont[];

// Uncomment the next line for Arduino 2009/Uno
//UTFT myGLCD(ITDB32S,19,18,17,16);   // Remember to change the model parameter to suit your display module!

// Uncomment the next line for Arduino Mega
UTFT myGLCD(CTE35IPS,25,26,27,28);   // Remember to change the model parameter to suit your display module!

extern unsigned short info[0x400];
extern unsigned short icon[0x400];
extern unsigned short tux[0x400];

void setup()
{
  myGLCD.InitLCD();
  myGLCD.setFont(SmallFont);
}

void loop()
{
  myGLCD.fillScr(255, 255, 255);
  myGLCD.setColor(255, 255, 255);
  myGLCD.print(" *** A 10 by 7 grid of a 32x32 icon *** ", CENTER, 228);
  for (int x=0; x<10; x++)
    for (int y=0; y<7; y++)
      myGLCD.drawBitmap (x*32, y*32, 32, 32, info);

  delay(5000);
  
  myGLCD.fillScr(255, 255, 255);
  myGLCD.setColor(255, 255, 255);
  myGLCD.print("   Two different icons in scale 1 to 4  ", CENTER, 228);
  int x=0;
  for (int s=0; s<4; s++)
  {
    x+=(s*32);
    myGLCD.drawBitmap (x, 0, 32, 32, tux, s+1);
  }
  x=0;
  for (int s=4; s>0; s--)
  {
    myGLCD.drawBitmap (x, 224-(s*32), 32, 32, icon, s);
    x+=(s*32);
  }

  delay(5000);

I also notice, that if I inlcude one of those files into my code. It, works, what is making me absolute crazy.
The only diference I catch, is that in the first line of the .c file, the numbers between the []s, are, in my files that I have converted with the UTFT converter, in digital ([15600],[2880]etc), and in the files that are working, them came in hexadecimal [0x400]); have this any sense???

And finally it works!

After several tries, I just want to discart de possibilty that the UTFT conversor was doing something that I can not understand actually, and I tried the regular arduino version of the .c file, not the DUE.
And it works like heaven. I dont really know why. But it works.
Maybe cause I'm using a shield? Maybe for the CTE display... I don know. But it works like that, and I'm happy. :smiley: