none
GDIPlus in Wince7 RRS feed

  • Question

  • Hi all,

    I want to know whether GDIPlus Library can be used in Wince7(ARM Architecture). If it is , How? Mainly i want this (GDIPlus) library for Antialiasing.

    IDE : Visual Studio.

    Programming Language : VC++ (MFC)

    Monday, September 9, 2019 9:32 AM

Answers

  • The libraries don't really have any code in them.  They all just point to the DLL.  The include files all force __stdcall, so calling convention shouldn't be an issue, as long as the CPU matches.  Are you using an x86-based WinCE, or one of the other weird CPUs?  Did you copy the 32-bit library?

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Sandeep M Y Thursday, October 31, 2019 5:24 AM
    Thursday, October 17, 2019 9:35 PM

All replies

  • My understanding is that the GdiPlus.dll is included with WinCE, but they don't include the library and include files because they don't want to support it, and some of the APIs are not implemented.  It's possible to copy gdiplus.lib and all of the gdiplusxxxx.h include files from a desktop Visual Studio implementation.

    However, based on what I read, none of the font and text functions are implemented.  If you're looking for antialiased fonts, you may need to consider a 3rd party library, like Cairo.


    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    Monday, September 9, 2019 8:41 PM
  • Hi,

    Thank you for posting here.

    >>I want to know whether GDIPlus Library can be used in Wince7(ARM Architecture). If it is , How? 

    Windows CE supports a subset of the desktop GDI. As far as I'm concerned Wince 7 comes with gdiplus.dll,but
    GDIPlus.h and other GDI+ header files are not included in Wince 7, and you must be obtained separately.

    For more details, I suggest you could refer to the link:http://www.stprec.co.jp/ceblog/2013/02/05/wec-7-%E4%BB%98%E5%B1%9E%E3%81%AE-gdiplus-dll/

    >>Mainly i want this (GDIPlus) library for Antialiasing.

    If you want to use Anti-Aliased fonts in WinCe, I suggest you could try to enable ClearType on Windows CE 7.0. ClearType is a software technology developed by Microsoft that improves the readability of text on existing LCDs.

    I suggest you could refer to the link. It's for CE 6 but applies also to Compact 7: https://blogs.msdn.microsoft.com/mikehall/2009/04/17/enabling-cleartype-on-windows-ce-6-0/

    Best Regards,

    Jeanine Zhang

    Disclaimer: This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

    Tuesday, September 10, 2019 2:16 AM
    Moderator
  • Hi,

    Have you got any updates? If your case has been solved, please help to mark answers. If not, just feel free to contact us.

    Your understanding and cooperation will be grateful.

    Best Regards,

    Jeanine Zhang

    Thursday, September 12, 2019 6:50 AM
    Moderator
  • Hi,

    Thanks for the updates,

    As Mentioned the GdiPlus.dll is not available with wince7.

    We Copied the GDiPlus Library as well as supported files from Desktop Application to MFC(Wince7 Based)."GdiPlus,lib" library is added in the path "Project Properties->Configuration Properties->Linker->Input->Additional Dependencies".

    We are facing Build Errors:

    error LNK2019: unresolved external symbol GdipCreateFromHDC referenced in function "public: __cdecl Gdiplus::Graphics::Graphics(struct HDC__ *)" (??0Graphics@Gdiplus@@QAA@PAUHDC__@@@Z)

    error LNK2019: unresolved external symbol GdipDeleteGraphics referenced in function "public: __cdecl Gdiplus::Graphics::~Graphics(void)" (??1Graphics@Gdiplus@@QAA@XZ).

    Can You please help for this.

    Thursday, September 12, 2019 9:04 AM
  • Hi,

    >>error LNK2019: unresolved external symbol GdipCreateFromHDC referenced in function "public: __cdecl Gdiplus::Graphics::Graphics(struct HDC__ *)" (??0Graphics@Gdiplus@@QAA@PAUHDC__@@@Z)
    error LNK2019: unresolved external symbol GdipDeleteGraphics referenced in function "public: __cdecl Gdiplus::Graphics::~Graphics(void)" (??1Graphics@Gdiplus@@QAA@XZ).

    I suggest you could try to add the following code in the source:

    #pragma comment (lib,"Gdiplus.lib")

    Best Regards,

    Jeanine Zhang


    Thursday, September 12, 2019 9:30 AM
    Moderator
  • hi,

    Thank u for ur reply

    As Mentioned we have used

    #include "gdiplus.h"
    using namespace Gdiplus;
    #pragma comment(lib,"gdiplus.lib");

    But Still the error exists. Can u give more details of this errors.

    Thursday, September 12, 2019 10:07 AM
  • Hi,

    As far as I'm concerned,the cause of this issue is that the object file or library that contains the definition of the symbol is not linked. I suggest you could refer to the link: https://docs.microsoft.com/en-us/cpp/error-messages/tool-errors/linker-tools-error-lnk2019?view=vs-2019

    You should make sure your linker knows where the gdiplus.lib file is.
    1,Configuration Properties -> C/C++ -> General -> Additional Include Directories. In the edit control, specify the path to the location of the gdiplus.h header file.
    2,Configuration Properties -> Linker -> General -> Additional Library Directories.In the edit control, specify the path to the location of the gdiplus.lib file.

    Best Regards,

    Jeanine Zhang

    Friday, September 13, 2019 1:32 AM
    Moderator
  • You should use dumpbin on the gdiplus.lib import library that you are using.

    Using dumpbin /exports will list all of the exported symbols from gdiplus.lib. This is important because it allows you to check if those symbols that is unable to resolve are actually exported.

    Also, I'm not sure if import libraries from other platforms could be used for ARM. I know for a fact that the x86 import library for GDI+ wouldn't work. The reason is because x86 Windows stdcall for the calling convention. This results in name mangling differences. For example:

    C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\x86>dumpbin /exports gdiplus.lib | find "GdipCreateFromHDC"
                      _GdipCreateFromHDC2@12
                      _GdipCreateFromHDC@8

    C:\Program Files (x86)\Windows Kits\10\Lib\10.0.18362.0\um\arm>dumpbin /exports gdiplus.lib | find "GdipCreateFromHDC"
                      GdipCreateFromHDC
                      GdipCreateFromHDC2

    So as you can see, they are named differently and so the x86 library could never resolve the names from the ARM version of the compiler. So at the very least you should get the ARM version of this library from the Windows 10 SDK.


    This is a signature. Any samples given are not meant to have error checking or show best practices. They are meant to just illustrate a point. I may also give inefficient code or introduce some problems to discourage copy/paste coding. This is because the major point of my posts is to aid in the learning process.

    Friday, September 13, 2019 2:22 AM
  • Hi all,

    i have discussed this topic with u guys previously and i tried all the solutions given.

    i need one more help, Is win32 based libraries can be used in wince7? Because GdiPlus Library i have used in wince7 but still i am getting linker errors (Followed all the instructions which was specified).

    Can u help me with this as soon as possible

    Thank u.

    Wednesday, October 16, 2019 10:28 AM
  • The libraries don't really have any code in them.  They all just point to the DLL.  The include files all force __stdcall, so calling convention shouldn't be an issue, as long as the CPU matches.  Are you using an x86-based WinCE, or one of the other weird CPUs?  Did you copy the 32-bit library?

    Tim Roberts | Driver MVP Emeritus | Providenza & Boekelheide, Inc.

    • Marked as answer by Sandeep M Y Thursday, October 31, 2019 5:24 AM
    Thursday, October 17, 2019 9:35 PM
  • Thank u for the reply,

    Now i don't have any issue with linking the libraries (.lib file)

    i am facing the issue in loading Dll's  , when i load the Gdiplus.dll(Desktop) with respect to wince7 SDK i am getting the error like "it is not a valid win32 application"

    The error i got through GetLastError() API

    Thursday, October 31, 2019 5:23 AM