Bitmap

This example shows a little dialog including a Bitmap

00001 /*
00002         Advanved Dialogs v1.05 - Example program
00003         Copyright (C) 2005-2007 Jonas Gehring
00004 
00005         Advanced Dialogs is free software; you can redistribute it and/or modify
00006         it under the terms of the GNU Lesser General Public License as published by
00007         the Free Software Foundation; either version 2 of the License, or
00008         (at your option) any later version.
00009 
00010         Advanced Dialogs is distributed in the hope that it will be useful,
00011         but WITHOUT ANY WARRANTY; without even the implied warranty of
00012         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013         GNU Lesser General Public License for more details.
00014 
00015         You should have received a copy of the GNU Lesser General Public License
00016         along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 // C Source File
00021 // Created 18.01.2006; 06:45:10
00022 
00023 
00024 
00025 #include <tigcclib.h>                                   // Include all standard header files
00026 
00027 #include <extgraph.h>                                   // Include ExtGraph v2.00beta5 by TI-Chess Team
00028 #include <AdvDialogs.h>                                 // Powered by Advanced Dialogs v1.05
00029 
00030 #include "adlogo.h"                                     // Advanced Dialogs logo (image data)
00031 
00032 
00033 // Main Function
00034 void _main(void)
00035 {
00036         void *buffer;
00037         
00038         // Allocate space for the LCD buffer
00039         if ((buffer = malloc(LCD_SIZE)) == NULL)
00040         {
00041                 return;
00042         }
00043 
00044         memcpy(buffer, LCD_MEM, LCD_SIZE);
00045         
00046         if (!GrayOn())                                                  // Turn on grayscale graphics
00047         {
00048                 free(buffer);
00049                 return;
00050         }
00051 
00052         memcpy(GrayGetPlane(LIGHT_PLANE), buffer, LCD_SIZE);
00053         memcpy(GrayGetPlane(DARK_PLANE), buffer, LCD_SIZE);
00054 
00055         // Create dialog
00056         ADVDIALOG *dialog = AdvDlgNew(135, 68, "Advanced Dialogs", FALSE);
00057         
00058         // Create bitmap
00059         ADVBITMAP *bitmap = AdvDlgBitmapNew(64, 28, adlogo2, adlogo1);
00060 
00061         // Add bitmap to the dialog
00062         if (bitmap != NULL)
00063         {
00064                 AdvDlgAddBitmap(dialog, 0, 2, 9, bitmap);
00065         }
00066 
00067         // Add text to the dialog
00068         AdvDlgAddText(dialog, 0, 0, "Advanced Dialogs", TXT_ALIGNRIGHT, COLOR_BLACK);
00069         AdvDlgAddText(dialog, 0, 1, "version "ADVDLG_VERSION_STR, TXT_ALIGNRIGHT, COLOR_BLACK);
00070         AdvDlgAddText(dialog, 0, 4, "visit our website:", TXT_STANDARD, COLOR_BLACK);
00071         AdvDlgAddText(dialog, 0, 5, "http://boolsoft.mobifiles.de", TXT_STANDARD, COLOR_WHITE);
00072         
00073         // Add button
00074         AdvDlgAddButton(dialog, 1, B_OK);
00075         
00076         // Execute dialog
00077         AdvDlgDo(dialog, DUMMY_HANDLER);
00078         
00079         // Free the dialog - this also frees all bitmaps that were added to it
00080         AdvDlgFree(dialog);
00081 
00082         GrayOff();
00083         
00084         memcpy(LCD_MEM, buffer, LCD_SIZE);
00085         free(buffer);
00086         
00087         ST_helpMsg("http://www.boolsoft.org");
00088 }
00089 

The Bitmap data is defined in adlogo.h:

00001 /*
00002         Advanved Dialogs v1.04 - Example program
00003         Copyright (C) 2005-2007 Jonas Gehring
00004 
00005         Advanced Dialogs is free software; you can redistribute it and/or modify
00006         it under the terms of the GNU Lesser General Public License as published by
00007         the Free Software Foundation; either version 2 of the License, or
00008         (at your option) any later version.
00009 
00010         Advanced Dialogs is distributed in the hope that it will be useful,
00011         but WITHOUT ANY WARRANTY; without even the implied warranty of
00012         MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013         GNU Lesser General Public License for more details.
00014 
00015         You should have received a copy of the GNU Lesser General Public License
00016         along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 // Header File
00021 // Created 18.01.2006; 06:46:12
00022 
00023 
00024 #ifndef _ADLOGO_H
00025 #define _ADLOGO_H
00026 
00027 
00028 // Image data for the logo
00029 const unsigned char adlogo1[] =
00030 {
00031 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00032 0x7E,0x18,0x00,0x00,0x00,0x01,0x80,0x00,0x7F,0xFF,0x67,0xBE,0xFB,0xEF,0xC0,0x00,
00033 0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x7F,0xFF,0xFF,0xFF,0xE3,0xFF,0xC0,0x00,
00034 0x77,0xFD,0xFF,0xFF,0xFB,0xEF,0xC0,0x00,0x33,0x7C,0xE7,0xDB,0x7D,0xF7,0xC0,0x00,
00035 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x00,0x00,
00036 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x60,0x30,0x00,0x00,
00037 0x00,0x00,0x00,0x3F,0x37,0xBF,0xDF,0x3C,0x00,0x00,0x00,0x3B,0xEF,0xFF,0xFF,0xFE,
00038 0x00,0x00,0x00,0x3B,0xFF,0xFF,0xFF,0xBC,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFE,
00039 0x00,0x00,0x00,0x1F,0x37,0xDB,0xEF,0xBC,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0x80,
00040 0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00041 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xEA,0x9D,0xDD,0x15,0x70,
00042 0x00,0x00,0x00,0x8A,0x89,0x55,0x19,0x20,0x00,0x00,0x00,0xAA,0x89,0x55,0x15,0x20,
00043 0x00,0x00,0x02,0xEE,0xA9,0xDD,0xD5,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
00044 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
00045 };
00046 
00047 const unsigned char adlogo2[] =
00048 {
00049 0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