2010-04-23 241 views

回答

0

假設你的意思是this Cimg庫,幾個draw_text的重載將採用名爲「font」的參數。這些似乎是一個合理的起點......

1

不。CImg的文字圖很簡單。

CImg<T>& draw_text(const int x0, const int y0, 
        const char *const text, 
        const int, const tc *const background_color, 
        const float opacity, const CImgList<t>& font, ...) 

font只是一個字母CImgList(即font[letter-'a']是 「字母」 的圖像)。要麼讓自己的或使用的內置選項之一:

static const CImgList<T>& font(const unsigned int font_height, 
           const bool variable_size=true); 

static CImgList<T> _font(const unsigned int *const font, 
         const unsigned int w, const unsigned int h, 
         const bool variable_size) 

其中font這裏是CImg.h的頂部,如font12x24預定義的字體之一。

相關問題