The title of the previous article is incorrect. It should be under WM.
The last time I tried my work, it proved that I could not. However, a practical version is provided here. Let me explain my trial results.
I. Installation
After the download, copy the file to the corresponding folder. The inlcude file is under Windows Mobile 6 SDK \ PocketPC \ Include \ Armv4i \ GDI + (I only tried WM ^, in this way, the problem is handled properly. Lib file to \ Windows Mobile 6 SDK \ PocketPC \ Lib \ Armv4i. Add these paths to the Reference Path.
2. Preparation
First, add
Include <gdiplus. h>
Using namespace Gdiplus;
# Pragma comment (lib, "LibGDIPlus. lib ")
In the Oncreat event, call
GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
GdiplusStartup (& gdiplusToken, & gdiplusStartupInput, NULL );
. Call in Ondestory event
GdiplusShutdown (gdiplusToken );
.
You can set gdiplusToken as a public variable. However, initialization cannot be performed in the DLL. I don't know why.
Iii. Use
The GDI + in wince has many features that are not implemented:
- No support to load image file directly from path
Use IStream interface to load file data, use the stream interface version to create bitmap. Same goes for resource.
- Windows Mobile doesn' t support the following features:
GDI Path (GDI path functions are not exported)
Enhanced Meta file
The previous one I think can solve this problem. One is to use ISTREAM, but it is complicated. The other is to use GDI.
M_bt = new Bitmap (: SHLoadImageFile (_ T ("\ Program Files \ aaa.png"), 0); The supported range is limited.
I have not tried it later.
Some problems were also found during the trial. The more important Drawimgae has 18 functions and only the following six are implemented.
Graphics: DrawImage (Image *, RectF &)
Graphics: DrawImage (Image *, INT)
Graphics: DrawImage (Image *, PointF *, INT, REAL, Unit, ImageAttributes *, DrawImageAbort, VOID *)
Graphics: DrawImage (Image *, REAL)
Graphics: DrawImage (Image *, Rect &) Graphics: DrawImage (Image *, RectF &, REAL, Unit, ImageAttributes *, DrawImageAbort, VOID *)
The two have no prototype.
Graphics: DrawImage (Image *, RectF &, RectF &, Unit, ImageAttributes *)
Graphics: DrawImage (Image *, RectF *, Matrix *, Effect *, ImageAttributes *, Unit *)
However, the main functions can still be implemented. In addition, RotateTransform is not supported, which is quite distressing.