In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to achieve 2D graphics drawing VxWorks, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
VxWorks's WindML not only supports the most basic 2D graphics drawing, but also encapsulates three controls: Window, Menu, and Button. Run a simple example and wish you all a happy Spring Festival.
The source code is as follows
# include
UGL_LOCAL UGL_STATUS cbDraw (WIN_ID winId, / * window ID * / WIN_MSG * pMsg, / * message (always MSG_DRAW) * / void * pData / * copy of data passed to winCreate () * / void * pParam / * parameter passed to winCbAdd () * /) {/ * fill window * / uglBackgroundColorSet with light blue (pMsg- > data.draw.gcId, WIN_LIGHTBLUE) UglLineWidthSet (pMsg- > data.draw.gcId, 0); uglRectangle (pMsg- > data.draw.gcId, pMsg- > data.draw.rect.left, pMsg- > data.draw.rect.top, pMsg- > data.draw.rect.right, pMsg- > data.draw.rect.bottom)
/ * draw white text in window * / uglForegroundColorSet (pMsg- > data.draw.gcId, WIN_WHITE); uglFontSet (pMsg- > data.draw.gcId, WIN_FONT_SMALL); uglTextDrawW (pMsg- > data.draw.gcId, 10, 10,-1, "Happy Spring Festival")
/ * return UGL_STATUS_FINISHED because default handling not needed * / return UGL_STATUS_FINISHED;}
Void testWin () {WIN_APP_ID appId; WIN_ID winId
/ * create an application context * / appId = winAppCreate ("New Year", 0,0,0, UGL_NULL)
/ * create a visible window with a border * / winId = winCreate (appId, UGL_NULL_ID, WIN_ATTRIB_FRAMED | WIN_ATTRIB_VISIBLE, 100,100,200,150, UGL_NULL, 0, UGL_NULL)
/ * add callback of MSG_DRAW, call * / winCbAdd (winId, MSG_DRAW, 0, cbDraw, UGL_NULL) when window is drawn
/ * paste window to the screen * / winAttach (winId, UGL_NULL_ID, UGL_NULL_ID);}
These are all the contents of the article "how to draw 2D graphics with VxWorks". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.