Article 6: display an image resource in the souI using the jiugongge stretching method

Source: Internet
Author: User

At the beginning, it may be difficult for beginners of souI to figure out the process of displaying an image resource in souI. Here is a simple example.

First, prepare a picture for example.

Step 1: We first copy this image file to the demo's uires, and create a new directory JPG with only this file 9.jpg

Step 2: Introduce the image resource in uires. idx.

  <jpg>    <file name="girl" path="jpg\9.jpg"/>  </jpg>

We name this resource "girl ".

Step 3: Define an imgframe object in the global or window skin node. It is defined in the partial skin of the main window.

<Skin> <! -- Local skin object --> <GIF name = "gif_horse" src = "GIF: gif_horse"/> <GIF name = "gif_penguin" src = "GIF: gif_penguin "/>  </skin>

Note the reference to girl in the above Code. We keep 150 vertices in the X and Y directions without stretching.

Step 4: Define an IMG control object in the UI to display the image.

    <page title="jpg:girl">          </page>

Success!

Run the program to check the effect.

The following is the zoom-in status:

We can see that the points on the edge and the center are stretched differently.

Let's look at the zoom-in status:

The effect looks better.

All the work is to modify the XML file and display an image without a line of C ++ code.

Loading images from a file is similar. You can refer to the example of loading GIF animation from a file in demo.

 

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.