zoukankan      html  css  js  c++  java
  • [Cursor Bitmap]Programatically Create Bitmap For Cursor

    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.

  • 相关阅读:
    按位与、或、非、异或总结
    Linux 挂载命令
    Linux 文件系统常用命令
    Linux 系统命令sudo权限
    Linux 文件系统属性chattr权限
    Linux 文件特殊权限-Sticky BIT
    Linux 文件特殊权限-SetGID
    Linux 文件特殊权限-SetUID
    Linux 递归acl权限和默认acl权限
    Linux 最大有效权限与删除ACL
  • 原文地址:https://www.cnblogs.com/taoxu0903/p/1750038.html
Copyright © 2011-2022 走看看