本文整理汇总了C++中GUI_DrawBitmap函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_DrawBitmap函数的具体用法?C++ GUI_DrawBitmap怎么用?C++ GUI_DrawBitmap使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_DrawBitmap函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _OnPaint_drowise
/**
* @brief Paints drowise button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_drowise(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmdes_water_sub, 0, 0);
}
else
{
GUI_DrawBitmap(&bmwater_sub, 0, 0);
}
}
示例2: _OnPaint_fullscreen
/**
* @brief Paints Full Screen button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_fullscreen(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmwindowfullscreen, 0, 0);
}
else
{
GUI_DrawBitmap(&bmwindownofullscreen, 0, 0);
}
}
示例3: _OnPaint_close
/**
* @brief Paints Close button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_close(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmclose_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmclose_not_pressed, 0, 0);
}
}
示例4: _DrawBkCircle
/*********************************************************************
*
* _DrawBkCircle
*/
static void _DrawBkCircle(int DrawLogo) {
static GUI_MEMDEV_Handle hMemStretch;
GUI_MEMDEV_Handle hMemGradient;
GUI_MEMDEV_Handle hMemCircle;
GUI_MEMDEV_Handle hMemOld;
int CircleWidth;
int ySizeV;
int xSize;
int ySize;
int i;
U32 * pData;
xSize = LCD_GetXSize();
ySize = LCD_GetYSize();
ySizeV = LCD_GetVYSize();
if (ySizeV > ySize) {
GUI_SetBkColor(BK_COLOR_1);
GUI_ClearRect(0, 0, xSize, ySizeV);
}
if (hMemStretch == 0) {
CircleWidth = (CIRCLE_RADIUS << 1) + 1;
hMemCircle = GUI_MEMDEV_CreateFixed(0, 0, CircleWidth, CircleWidth, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_32, GUI_COLOR_CONV_8888);
hMemStretch = GUI_MEMDEV_CreateEx (0, 0, xSize, ySize, GUI_MEMDEV_NOTRANS);
hMemGradient = GUI_MEMDEV_CreateFixed(0, 0, 1, CIRCLE_RADIUS, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_32, GUI_COLOR_CONV_8888);
//
// Initialize background
//
hMemOld = GUI_MEMDEV_Select(hMemCircle);
GUI_SetBkColor(BK_COLOR_1);
GUI_Clear();
//
// Create Gradient
//
GUI_MEMDEV_Select(hMemGradient);
GUI_DrawGradientV(0, 0, 0, CIRCLE_RADIUS, BK_COLOR_0, BK_COLOR_1);
//
// Get color and draw circles
//
pData = (U32 *)GUI_MEMDEV_GetDataPtr(hMemGradient);
GUI_MEMDEV_Select(hMemCircle);
for (i = 0; i < CIRCLE_RADIUS; i++, pData++) {
GUI_SetColor(*pData);
GUI_DrawCircle(CIRCLE_RADIUS, CIRCLE_RADIUS, i);
}
//
// Stretch and display
//
GUI_MEMDEV_Select(hMemStretch);
GUI_MEMDEV_DrawPerspectiveX(hMemCircle, 0, 0, ySize, ySize, xSize, 0);
GUI_MEMDEV_Delete(hMemCircle);
GUI_MEMDEV_Delete(hMemGradient);
GUI_MEMDEV_Select(hMemOld);
}
GUI_MEMDEV_Write(hMemStretch);
if (DrawLogo) {
GUI_DrawBitmap(&bmSTLogo70x35, LOGO_DIST_BORDER, LOGO_DIST_BORDER);
}
}
示例5: _ExecKeyboard
static int _ExecKeyboard(void) {
int i;
int Key;
BUTTON_Handle ahButton[52];
BUTTON_Handle hButtonESC;
EDIT_Handle hEdit;
GUI_RECT rText = {000,0, LCD_XSIZE, 20};
GUI_SetBkColor(GUI_RED);
GUI_Clear();
GUI_DrawBitmap(&bmSeggerLogoBlue, 0, 0);
GUI_SetFont(&GUI_FontComic18B_ASCII);
GUI_SetColor(GUI_WHITE);
GUI_DispStringInRect("emWin", &rText, GUI_TA_RIGHT | GUI_TA_VCENTER);
rText.y0 +=20;
rText.y1 +=20;
GUI_DispStringInRect("Touch screen demo", &rText, GUI_TA_RIGHT | GUI_TA_VCENTER);
/* Create Keyboard Buttons */
for (i=0; i< 51; i++) {
int Pos = (i < 47) ? i : i+4;
int x0 = 5 + 28*(Pos%11);
int y0 = 100 + 28*(Pos/11);
char c = _acText[i];
int Id = c ? c : 1;
char ac[2] = {0};
char *s= ac;
ac[0] = c;
ahButton[i] = BUTTON_Create( x0, y0, 25, 25, Id,BUTTON_CF_SHOW );
BUTTON_SetText (ahButton[i], s);
#if GUI_SUPPORT_MEMDEV
BUTTON_EnableMemdev(ahButton[i]);
#endif
}
ahButton[i] = BUTTON_Create( 89, 212, 109, 25, ' ',BUTTON_CF_SHOW );
hButtonESC = BUTTON_Create( 230, 40, 80, 25, GUI_ID_CANCEL,BUTTON_CF_SHOW );
BUTTON_SetText (hButtonESC, "ESC");
hEdit = EDIT_Create( 5, 70, 310, 25, ' ', 80, 0 );
EDIT_SetFont(hEdit, &GUI_Font8x16);
BUTTON_SetBkColor(ahButton[49], 0, GUI_RED);
BUTTON_SetBkColor(ahButton[50], 0, GUI_BLUE);
/* Handle Keyboard until ESC or ENTER is pressed */
do {
Key = GUIDEMO_WaitKey();
switch (Key) {
case 0:
case GUI_ID_CANCEL:
break;
default:
EDIT_AddKey(hEdit, Key);
}
} while ((Key != 'N') && (Key!=GUI_ID_CANCEL) && (Key!=0));
/* Cleanup */
for (i=0; i< countof(ahButton); i++) {
BUTTON_Delete(ahButton[i]);
}
BUTTON_Delete(hButtonESC);
EDIT_Delete(hEdit);
return Key;
}
示例6: _OnPaint_repeat
/**
* @brief Paints repeat button
* @param repeat_status: repeat button status
* @retval None
*/
static void _OnPaint_repeat(uint32_t repeat_status) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if(PlayerSettings.b.repeat == REPEAT_NONE)
{
GUI_DrawBitmap(&bmrepeat_off, 0, 0);
}
else if(PlayerSettings.b.repeat == REPEAT_ONCE)
{
GUI_DrawBitmap(&bmrepeat1, 0, 0);
}
else if(PlayerSettings.b.repeat == REPEAT_ALL)
{
GUI_DrawBitmap(&bmrepeat_all, 0, 0);
}
}
示例7: k_InitMenu
/**
* @brief Initializes the menu.
* @param None.
* @retval None.
*/
void k_InitMenu(void)
{
WM_HWIN hItem;
uint8_t i = 0;
GUI_SetLayerVisEx (0, 0);
GUI_DrawBitmap(&bmbackground, 0,0);
settings.d32 = k_BkupRestoreParameter(CALIBRATION_GENERAL_SETTINGS_BKP);
GUI_SetLayerVisEx (0, 1);
GUI_SelectLayer(1);
GUI_Clear();
WM_SetCallback(WM_HBKWIN, _cbBk);
WM_CreateWindowAsChild(0,
0,
LCD_GetXSize(),
25,
WM_HBKWIN,
WM_CF_SHOW | WM_CF_HASTRANS ,
_cbStatus,
0);
hIcon = ICONVIEW_CreateEx(0,
26,
LCD_GetXSize(),
LCD_GetYSize()- 26,
WM_HBKWIN,
WM_CF_SHOW | WM_CF_HASTRANS | WM_CF_BGND ,
ICONVIEW_CF_AUTOSCROLLBAR_V,
ID_ICONVIEW_MENU,
112,
105);
ICONVIEW_SetFont(hIcon, &GUI_Font13B_ASCII);
ICONVIEW_SetBkColor(hIcon, ICONVIEW_CI_SEL, GUI_LIGHTBLUE |GUI_TRANSPARENT);
ICONVIEW_SetSpace(hIcon, GUI_COORD_Y, 10);
ICONVIEW_SetFrame(hIcon, GUI_COORD_Y, 10);
for (i = 0; i < k_ModuleGetNumber(); i++)
{
ICONVIEW_AddBitmapItem(hIcon,module_prop[i].module->icon, (char *)module_prop[i].module->name);
}
if(settings.b.enable_sprite)
{
_ShowSprites();
}
hItem = BUTTON_CreateEx(0, 0, 40, 23, WM_HBKWIN, WM_CF_SHOW, 0, ID_BUTTON_BKGND);
WM_SetCallback(hItem, _cbButton);
}
示例8: _OnPaint_camera
/**
* @brief Paints camera button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_camera(BUTTON_Handle hObj, uint32_t alarm_status, uint32_t camera_status) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
GUI_DrawBitmap(&bmcamera, 0, 0);
if(HomeSettings.b.alarm == ALARM_ON)
{
if(HomeSettings.b.camera != CAM_DESACTIVATED)
{
GUI_DrawBitmap(&bmdes_camera, 0, 0);
}
}
else
{
GUI_DrawBitmap(&bmcamera, 0, 0);
}
}
示例9: _DrawBk
static void _DrawBk(int DrawLogo) {
int xSize, ySize;
xSize = LCD_GetXSize();
ySize = LCD_GetYSize();
GUI_DrawGradientV(0, 0, xSize, ySize, BK_COLOR_0, BK_COLOR_1);
if (DrawLogo) {
GUI_DrawBitmap(&bmSeggerLogo70x35, 5, 5);
}
}
示例10: _DrawBitmap
/********************************************************************
*
* _DrawBitmap
*/
static _DrawBitmap(const GUI_BITMAP* pBitmap, int x, int y, int Trans, int XOr) {
GUI_LOGPALETTE Pal;
GUI_BITMAP Bitmap;
int PrevDM;
memcpy(&Bitmap, pBitmap, sizeof(GUI_BITMAP));
memcpy(&Pal, Bitmap.pPal, sizeof(GUI_LOGPALETTE));
Bitmap.pPal = &Pal;
Pal.HasTrans = Trans;
PrevDM = GUI_SetDrawMode((XOr) ? GUI_DM_XOR : 0);
GUI_DrawBitmap(&Bitmap, x, y);
GUI_SetDrawMode(PrevDM);
}
示例11: _Paint
/*********************************************************************
*
* _Paint
*/
static void _Paint(xIconSelBtn_Handle hWin)
{
GUI_RECT WinRect;
xIconSelBtn_OBJ tWidget;
GUI_CONST_STORAGE GUI_BITMAP* pBMP;
int xSize, ySize;
if(!hWin) return;
DEBUGOUT("xIconSelBtn hWin = 0x%08x\r\n", hWin);
WM_GetWindowRectEx(hWin, &WinRect);
GUI_MoveRect(&WinRect, -WinRect.x0, -WinRect.y0);
DEBUGOUT("xIconSelBtn Paint(%d,%d,%d,%d)\r\n",WinRect.x0, WinRect.y0, WinRect.x1, WinRect.y1);
BUTTON_GetUserData(hWin, &tWidget, sizeof(xIconSelBtn_OBJ));
tWidget.hThis = hWin;
BUTTON_SetUserData(hWin, &tWidget, sizeof(xIconSelBtn_OBJ));
if(tWidget.pBkBMP)
{
GUI_DrawBitmap(tWidget.pBkBMP, WinRect.x0, WinRect.y0);
}
else
{
//Draw Window Frame Outline, and Background.
GUI_SetColor(tWidget.aBkColor[0]);
//Draw Window Frame Outline, and Background.
GUI_FillRoundedRect(WinRect.x0, WinRect.y0, WinRect.x1, WinRect.y1, 1);
}
xSize = WinRect.x1 - WinRect.x0;
ySize = WinRect.y1 - WinRect.y0;
pBMP = tWidget.xIconArray[tWidget.SelectedIndex].pBMP;
if(pBMP)
{
//Draw BMP in H & V center
GUI_DrawBitmap(pBMP, WinRect.x0 + (xSize - pBMP->XSize)/2 , WinRect.y0 + (ySize - pBMP->YSize)/2 );
}
}
示例12: ANIM_prerenderFrames
void ANIM_prerenderFrames(void)
{
uint32_t i;
uint32_t magicWord = 0xef32;
/* Get the starting address of the prerendered frames */
uint32_t *addr = (uint32_t *)FRAMES_START;
/* Get the end of the prerendered frames */
uint32_t *lastAddr = addr + FRAME_BUFFER_SIZE_WORDS * NUM_FRAMES;
/* Get the address of the current frame buffer */
uint16_t *frameBuffer = FB_getActiveBuffer();
/* Check the last address for the magic word.
* If this has been written the frames are already in flash
* and we can skip the entire prerendering step */
if ( *lastAddr == magicWord ) {
return;
}
MSC_Init();
/* Make emWin draw to the frame buffer */
FB_activateFrameBuffer();
/* Add meta data to frame buffer */
FB_writeControlSignals((uint8_t*)frameBuffer);
/* Erase all the pages we are going to write to */
while ( addr < lastAddr ) {
MSC_ErasePage(addr);
addr += FRAME_BUFFER_SIZE_WORDS;
}
addr = (uint32_t *)FRAMES_START;
for ( i=0; i<NUM_FRAMES; i++ ) {
/* Render a frame */
GUI_DrawBitmap(frames[i], 0, 0);
/* Copy entire frame buffer to flash */
MSC_WriteWord(addr, frameBuffer, FRAME_BUFFER_SIZE_BYTES);
addr += FRAME_BUFFER_SIZE_WORDS;
}
/* Write magic word to indicate that the frames are ready in Flash */
MSC_WriteWord(lastAddr, &magicWord, 4);
MSC_Deinit();
}
示例13: GUIDEMO_Intro
void GUIDEMO_Intro(void) {
int xCenter = LCD_GET_XSIZE() / 2;
int y;
char acText[50] = "Version of uC/GUI: ";
strcat(acText, GUI_GetVersionString());
GUI_SetBkColor(GUI_BLUE);
GUI_SetColor(GUI_LIGHTRED);
GUI_Clear();
GUI_SetFont(&GUI_Font24B_1);
GUI_DispStringHCenterAt("uC/GUI", xCenter, y= 15);
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font13H_ASCII);
GUI_DispStringHCenterAt("Universal graphic software"
"\nfor embedded applications"
, xCenter, y += 30);
GUI_SetColor(GUI_LIGHTRED);
GUI_SetFont(&GUI_Font16_ASCII);
GUI_DispStringHCenterAt("Any CPU - Any LCD - Any Application"
, xCenter, y += 40);
GUI_SetFont(&GUI_Font10S_ASCII);
GUI_DispStringHCenterAt("Compiled " __DATE__ " "__TIME__, xCenter, y += 25);
GUI_SetFont(&GUI_Font13HB_1);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt(acText, xCenter, y += 21);
GUI_SetFont(&GUI_FontComic18B_1);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt("www.micrium.com", LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() - 40);
GUI_DrawBitmap(&bmMicriumLogo, (LCD_GET_XSIZE() - bmMicriumLogo.XSize) / 2, 150);
GUI_SetFont(&GUI_Font10S_ASCII);
GUI_DispStringAt("GUI_OS: ", 0,210); GUI_DispDecMin(GUI_OS);
GUI_DispStringAt("GUI_ALLOC_SIZE: ",0, 220); GUI_DispDecMin(GUI_ALLOC_SIZE);
GUI_DispStringAt("Compiler: "
#ifdef _MSC_VER
"Microsoft"
#elif defined (NC308)
"Mitsubishi NC308"
#elif defined (NC30)
"Mitsubishi NC30"
#elif defined (__TID__)
#if (((__TID__ >>8) &0x7f) == 48) /* IAR MC80 */
"IAR M32C"
#elif (((__TID__ >>8) &0x7f) == 85) /* IAR V850 */
"IAR V850"
#else /* IAR MC16 */
"IAR M32C"
#endif
#else
"Unknown"
#endif
,0, 230);
GUIDEMO_Delay(5000);
}
示例14: _OnPaint_stop
/**
* @brief Paints Stop button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_stop(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if((RecorderMode == RECORDER_MODE_REC_IDLE)||
(RecorderMode == RECORDER_MODE_REC_DISABLED))
{
GUI_DrawBitmap(&record_bmstop_des, 0, 0);
}
else
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&record_bmstop_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&record_bmstop, 0, 0);
}
}
}
示例15: _OnPaint_record
/**
* @brief Paints record button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_record(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if(RecorderMode == RECORDER_MODE_REC_DISABLED)
{
GUI_DrawBitmap(&bmrecord_disabled, 0, 0);
}
else if(RecorderMode == RECORDER_MODE_PLAYING)
{
GUI_DrawBitmap(&record_bmplay_pressed, 0, 0);
}
else if(RecorderMode == RECORDER_MODE_REC_IDLE)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmrecord_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmrecord, 0, 0);
}
}
else if(RecorderMode == RECORDER_MODE_PLAY_IDLE)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&record_bmplay_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&record_bmplay, 0, 0);
}
}
else if(RecorderMode == RECORDER_MODE_RECORDING)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmcancel, 0, 0);
}
else
{
GUI_DrawBitmap(&bmcancel_unpressed, 0, 0);
}
}
}