這篇文章主要介紹vxworks中如何使用UGL實現封閉圖形的填充,文中介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們一定要看完!
創(chuàng)新互聯建站是一家專注于成都網站設計、網站制作與策劃設計,葉縣網站建設哪家好?創(chuàng)新互聯建站做網站,專注于網站建設十載,網設計領域的專業(yè)建站公司;建站業(yè)務涵蓋:葉縣等地區(qū)。葉縣做網站價格咨詢:18980820575
代碼如下
#include
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實現封閉圖形的填充”這篇文章的所有內容,感謝各位的閱讀!希望分享的內容對大家有幫助,更多相關知識,歡迎關注創(chuàng)新互聯行業(yè)資訊頻道!