您好,登錄后才能下訂單哦!
這篇文章主要介紹vxworks中如何使用UGL實現封閉圖形的填充,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
代碼如下
#include <ugl/ugl.h>
void uglTest ()
{
#define WIDTH 32
#define HIGHT 32
UINT8 patternData[WIDTH*HIGHT/__SIZEOF_INT__] =
{
0x00,0x0f,0xf0,0x00,
0x00,0x7f,0xfe,0x00,
0x01,0xff,0xff,0x80,
0x03,0xff,0xff,0xc0,
0x07,0xff,0xff,0xe0,
0x0f,0xff,0xff,0xf0,
0x1f,0xff,0xff,0xf8,
0x3f,0xff,0xff,0xfc,
0x3f,0x8f,0xf1,0xfc,
0x7f,0x07,0xe0,0xfe,
0x7f,0x07,0xe0,0xfe,
0x7f,0x07,0xe0,0xfe,
0xff,0x8f,0xf1,0xff,
0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,
0xff,0xff,0xff,0xff,
0xf9,0xff,0xff,0x9f,
0x79,0xff,0xff,0x9e,
0x78,0xff,0xff,0x1e,
0x7c,0xff,0xff,0x3e,
0x3c,0x7f,0xfe,0x3c,
0x3e,0x1f,0xf8,0x7c,
0x1f,0x03,0xe0,0xf8,
0x0f,0xc0,0x03,0xf0,
0x07,0xf8,0x1f,0xe0,
0x03,0xff,0xff,0xc0,
0x01,0xff,0xff,0x80,
0x00,0x7f,0xfe,0x00,
0x00,0x0f,0xf0,0x00
};
UGL_REG_DATA *pRegData;
UGL_GC_ID gc;
UGL_MDDB_ID patternDdb;
UGL_MDIB patternDib = {WIDTH, HIGHT, WIDTH, patternData};
uglDisplayOpen(0, 0, 0);
pRegData = uglRegistryFind (UGL_DISPLAY_TYPE, 0, 0, 0);
gc = uglGcCreate((UGL_DEVICE_ID)pRegData->id);
patternDdb = uglMonoBitmapCreate((UGL_DEVICE_ID)pRegData->id, &patternDib,
UGL_DIB_INIT_DATA, 0, UGL_NULL);
uglFillPatternSet(gc, patternDdb);
uglForegroundColorSet(gc, 0xff0000);
uglBackgroundColorSet(gc, 0x00ff00);
uglEllipse(gc, 10, 10, 200, 300, 0, 0, 0, 0);
uglRectangle(gc, 250, 10, 350, 300);
return;
}
以上是“vxworks中如何使用UGL實現封閉圖形的填充”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。