[Cursor bitmap] programatically create bitmap for cursor

Source: Internet
Author: User
1. How to programatically create a bitmap by filling in existing images.
Steps:
A. Create an empty bitmap with you wanted size and get graphics from it.
B. Create texturebrushes with intended to fill in images. set its visible region in the new bitmap by specifying its rectangle well; and pay attention to wrapmode.
C. Use the graphics to fill in the intended Images Using texturebrushes.
2. Some tips:
A. cursor object can only hold 32*32 image. If giving a larger image, as its rectangle size is 32*32, so that's the always visible part to user.
B. You can create an empty bitmap and using the graphics got from it to fill things (especially useful is texture like other bitmap, icons, etc) into it.
C. texturebrush can be used to fill in other images into a grahpics. Attention to its wrapmode. Take flip for example: it will always flip the image in the targeted image whole size, while
Using the rectangle to define the visible part.
D. If you are not satisfied with normal arrangement by texturebrush's wrapmode, You can further create and apply matrix to do for example x/y offset, rotation, etc to control how to fill
Using the texture brush on the target bitmap.
E. cursor. Draw (graphics, rectangle) can draw the cursor look into the target graphics.

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.