GDI + under WM (continued)

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.