GUI graphics screen display bmp bit picture in Emwin application

Source: Internet
Author: User
Tags directory create

1.1 software that needs to be installed

(1) Mdk-arm V5.10:

Install the STM32F2XX pack after installing Mdk-arm V5.10 (MDK V5.10 can only install Keil.stm32f2xx_dfp.2.1.0.pack or earlier), if you do not want to install the pack, install MDK cortex-m Legacy Device Support V5.10 (Mdkcm510.exe) is also available, and Mdk-arm V5.10 later versions are not supported for Chinese UTF-8 encoding.

(2) J-link related drivers.

1.2 Connecting Hardware

1.3 Access to GUI graphics screen Nand-flash

(1) Power GUI graphics screen and plug the N-link download line into the computer USB interface (two steps in no particular order).

(2) Click on the N-link connection button, GUI graphics screen can enter the U disk mode (using the system comes with the driver), then you can be the same as the U disk to access GUI graphics screen Nand-flash (write speed 3.2mbytes/s, read speed 5.6mbytes/s) GUI Graphics screen is not displayed after entering the USB drive mode.

(3) Copy the Nand-flash data to the local disk and format the Nand-flash:

Note: 256Mbyte products are formatted as FAT32 or fat, but 128Mbyte products can only be formatted as FAT.

1.4 Establishing Helloword Routines

(1) Open the project with MDK:

.. \docs\democodes\empty_prj_emwin_noos_207ve_spi\mdk_proj\demo_emwin.uvproj

(2) Modify the Maintask.c file:

#include "Dialog.h"

#include <string.h>

#include <stdio.h>

#include "stm32f2xx.h"

#include "Glcd.h"

void Maintask (void)

{

Gui_init ();

_mhelloword (Wm_hbkwin);

while (1) {gui_delay (20);}

}

(3) in.. \docs\democodes\empty_prj_emwin_noos_207ve_spi\application Directory Create helloword.c file and join the project:

(4) Writing HELLOWORD.C program:

#include "GUI.h"

#include "Dialog.h"

#include "Bitmap.h"

#define ID_WIN 1001

#define ID_BUT 1002

static const Gui_widget_create_info _ahelloword[] =//control struct-body array

{

{window_createindirect, 0, Id_win, 0, 0, 640, 480, 0, 0},

{button_createindirect, "Helloword", Id_but, 280, 430, 80, 20},

};

static void _cbhelloword (wm_message* pMsg)//form callback function

{

Switch (pmsg->msgid)

{

Case WM_PAINT:

Gui_drawbitmap (&background, 0, 0); Redraw a background picture

Break

Case Wm_init_dialog:

Break

Case Wm_notify_parent:

Break

Default

Wm_defaultproc (PMSG);

Break

}

}

Wm_hwin _mhelloword (Wm_hwin hparent)//Form creation function

{

Wm_hwin Hwin;

Hwin = Gui_createdialogbox (_ahelloword, Gui_countof (_ahelloword), _cbhelloword, hparent, 0, 0);

return Hwin;

}

(5) Create a background image with the system Drawing tool: Background.bmp (resolution 640*480)

(6) Copy bitmap list Generation tool: \docs\tools\bmpgen.exe to Nand-flash root and double-click to run, it will generate BITMAP.C, bitmap.h two files, bitmap.c, bitmap.h copy and add to MDK project:

(7) Compiling Helloword project

1.5 Uninstalling the GUI graphics screen Nand-flash

When the N-link download line is idle (the LED no longer flashes), click the Connect button of the N-link download line (or uninstall it like a USB flash drive, unplug the N-link download line directly from the computer), and the GUI graphics screen will restart and enter the working mode.

1.6 Download and run the Helloword routine

GUI Graphics Screen Manual

First time using GUI graphical screen _helloword routines

GUI Graphics Screen performance test (SPI interface)

Emwin precautions

Emwin Drive Transplant (UP)

Emwin Drive transplant (bottom)

Emwin using fonts and bitmaps

GUI graphics screen display bmp bit picture in Emwin application

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.