3D effects of images on Windows Mobile

Source: Internet
Author: User

Sometimes we need cool effects to dress up our programs.

The following figure shows the sliding effect of S1 from right to left.

 

 

 

 

 

 

What do you mean?

In fact, the principle is not complex, and a drawing function stretchblt is used.

 

Function: Copies a bitmap from the source rectangle to the target rectangle. If necessary, the image is stretched or compressed in the current mode set by the target device.
Function prototype: bool sequence (HDC hdcdest, int sequence, int nyorigindest, int sequence, int sequence, HDC hdcsrc, int nxoriginsrc, int nyoriginsrc, int nwidthsrc, int nheightsrc, DWORD dwrop );
Parameters:
Hdcdest: The handle pointing to the target device environment.
Nxorigindest: Specifies the x-axis coordinate in the upper-left corner of the target rectangle, which is expressed in logical units.
Nyorigindest: Specifies the Y axis coordinate in the upper left corner of the target rectangle, which is expressed by logical unit.
Nwidthdest: Specify the width of the target rectangle, which is expressed in logical units.
Nheightdest: Specify the height of the target rectangle, which is expressed in logical units.
Hdcsrc: refers to the handle to the Source Device environment.
Nxoriginsrc: X axis coordinates in the upper left corner of the source rectangle area. The coordinates are expressed in logical units.
Nyoriginsrc: refers to the y-axis coordinate in the upper left corner of the source rectangular area. The coordinate is expressed in logical units.
Nwidthsrc: Specifies the width of the source rectangle, which is expressed in logical units.
Nheightsrc: Specifies the height of the source rectangle, which is expressed in logical units.
Dwdrop: Specify the grating operation to be performed. The raster operation code defines how the system combines colors in the output operations, including brushes, source bitmaps, and target bitmaps. Refer to bitblt for a list of commonly used grating operation codes.
Returned value: if the function is successfully executed, the returned value is non-zero. If the function fails to be executed, the returned value is zero.

We divide a rectangle into several small rectangles. For each small rectangle, we use the stretchblt function to narrow down or enlarge the content to a specific target area. By looking at it with the naked eye, you can see 3d effects.

 

As long as your imagination is rich enough, you can use this function to make a variety of Fancy effects. For example, there are many revolving doors, such as magnifiers, such.

 

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.