Hello,
I have the FEZ CerbuinoNet microntroller board and a N18 Display module. I am trying to get images greater then 50x50 to display onto the screen but I am having issues.
I have read up on some things and have found out that the memory of the board is not large enough to support anything larger then 50x50. I read that to accomplish this, you have to load the image as pieces and load one at a time to the desired location on the screen and dispose of the image before loading the next piece. Problem is that I tried that and it is not working.
What I did was this. I created a 50x50 bitmap object and loaded it with the bitmap file data from the resources of the entire application. I then used the Display.SimpleGraphics.DisplayImage() function to show the image. I would then just call Bitmap.Dispose(), then load another seperate copy of the resources image into a different Bitmap object and tried to draw it to the screen like the first time. Of course this doesn’t work. I also have tried to just use the displays standard Draw() and DrawRaw() methods like the GHI website example says to and no luck.
Is there another way to dispose of the bitmap from memory before loading the second image? I thought maybe by the time the code tries to run the code for loading the second image, garbage collection hasn’t fully disposed of the bitmap and memory has not been released yet.
/// <summary>
/// Sets up the user interface.
/// </summary>
private void SetupUI()
{
Bitmap pic1 = Resources.GetBitmap(Resources.BitmapResources._50x50);
Bitmap pic2;
dspDisplay.SimpleGraphics.DisplayImage(pic1, 0, 0);
pic1.Dispose();
pic2 = Resources.GetBitmap(Resources.BitmapResources._50x50);
dspDisplay.SimpleGraphics.DisplayImage(pic2, 51, 0);
pic2.Dispose();
}