在VS2010中调用GDI+时,

Font font(&fontFamily,24,FontStyleRegular,UnitPixel);

会提示提示“Font”: 不明确的符号的问题

1>          可能是“c:/program files/microsoft visual studio 10.0/vc/include/comdef.h(312) : Font”
1>          或       “c:/program files/microsoft sdks/windows/v7.0a/include/gdiplusheaders.h(244) : Gdiplus::Font”

解决方法:

把#include <GdiPlus.h>
#pragma comment(lib, "gdiplus.lib")

using namespace Gdiplus;

放到系统的头文件之前才行,

原错误代码修改为Gdiplus::Font font(&fontFamily,24,FontStyleRegular,UnitPixel);

相关文章:

  • 2021-11-08
  • 2022-12-23
  • 2021-08-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2021-07-14
  • 2021-04-12
  • 2022-12-23
  • 2021-08-03
  • 2021-11-30
  • 2021-06-02
相关资源
相似解决方案