{
  "schemaVersion": "0.11.0",
  "canonical": "https://www.pystone.net/notes/unity-image-raw-image/",
  "atlas": "https://www.pystone.net/?node=unity-image-raw-image#knowledge-atlas",
  "markdown": "https://www.pystone.net/notes/unity-image-raw-image.md",
  "context": "https://www.pystone.net/notes/unity-image-raw-image.context.json",
  "knowledgeVersion": "224c990773de.5fa8af6e39fa",
  "build": {
    "siteCommit": "224c990773de166d23a886306577dd90379529ce",
    "notesCommit": "5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a",
    "builtAt": "1970-01-01T00:00:00.000Z",
    "version": "224c990773de.5fa8af6e39fa"
  },
  "id": "note:unity-image-raw-image",
  "slug": "unity-image-raw-image",
  "title": "Image & Raw Image",
  "type": "note",
  "visibility": "public",
  "idStability": "rename-stable",
  "author": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "publisher": {
    "name": "Perrin Yong",
    "profile": "https://www.pystone.net/profile/"
  },
  "aliases": [],
  "summary": "Image & Raw Image 创建时间：2020/9/9 11:51",
  "contentRole": "unspecified",
  "isMoc": false,
  "mocRecognition": "none",
  "generated": false,
  "attribution": "unspecified",
  "domain": "10-计算机、信息技术与工程",
  "tags": [],
  "mocs": [],
  "contentHash": "f049bb2fb36e963461a9fcffd825e41106aab07206212198d0fe419ba180c755",
  "assets": [
    {
      "reference": "assets/20200103131209912.png",
      "url": "/media/50046d8c97e7b03b2eaa.png",
      "mediaType": "image/png",
      "contentHash": "50046d8c97e7b03b2eaaa90f8b41a14065d8224c416cb07757910a6c03b8dc51",
      "byteLength": 60957,
      "width": 1892,
      "height": 438
    },
    {
      "reference": "assets/20200103132414236.png",
      "url": "/media/1de650a25a2cfe78fbd0.png",
      "mediaType": "image/png",
      "contentHash": "1de650a25a2cfe78fbd093b0b8f07232b476d4599d191ef66cee9dd24847708f",
      "byteLength": 33258,
      "width": 690,
      "height": 448
    }
  ],
  "headings": [
    {
      "depth": 1,
      "text": "Image & Raw Image",
      "anchor": "image-raw-image",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#image-raw-image"
    },
    {
      "depth": 2,
      "text": "Image & Raw Image",
      "anchor": "image-raw-image-1",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#image-raw-image-1"
    },
    {
      "depth": 2,
      "text": "Image",
      "anchor": "image",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#image"
    },
    {
      "depth": 3,
      "text": "特点",
      "anchor": "特点",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#%E7%89%B9%E7%82%B9"
    },
    {
      "depth": 3,
      "text": "属性",
      "anchor": "属性",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#%E5%B1%9E%E6%80%A7"
    },
    {
      "depth": 4,
      "text": "Image Type",
      "anchor": "image-type",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#image-type"
    },
    {
      "depth": 5,
      "text": "Simple",
      "anchor": "simple",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#simple"
    },
    {
      "depth": 5,
      "text": "Sliced",
      "anchor": "sliced",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#sliced"
    },
    {
      "depth": 5,
      "text": "Tilled",
      "anchor": "tilled",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#tilled"
    },
    {
      "depth": 5,
      "text": "Filled",
      "anchor": "filled",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#filled"
    },
    {
      "depth": 2,
      "text": "Raw Image",
      "anchor": "raw-image",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#raw-image"
    },
    {
      "depth": 3,
      "text": "特点",
      "anchor": "特点-1",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#%E7%89%B9%E7%82%B9-1"
    },
    {
      "depth": 3,
      "text": "属性",
      "anchor": "属性-1",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#%E5%B1%9E%E6%80%A7-1"
    },
    {
      "depth": 2,
      "text": "Ref",
      "anchor": "ref",
      "citation": "https://www.pystone.net/notes/unity-image-raw-image/#ref"
    }
  ],
  "claims": [],
  "outgoing": [],
  "incoming": [
    {
      "id": "note:game-graphics-and-runtime",
      "title": "游戏图形与运行时",
      "url": "https://www.pystone.net/notes/game-graphics-and-runtime/",
      "atlas": "https://www.pystone.net/?node=game-graphics-and-runtime#knowledge-atlas",
      "label": "游戏图形与运行时",
      "origin": "explicit",
      "humanReviewed": true,
      "context": "Unity中的“Image & Raw Image”导航项",
      "citation": "https://www.pystone.net/notes/game-graphics-and-runtime/#unity"
    }
  ],
  "contentMarkdown": "# Image & Raw Image\n> 创建时间：2020/9/9 11:51\n\n## Image & Raw Image\n\n  * Image & Raw Image\n    * Image\n      * 特点\n      * 属性\n        * Image Type\n          * Simple\n          * Sliced\n          * Tilled\n          * Filled\n    * Raw Image\n      * 特点\n      * 属性\n    * Ref\n\n## Image\n\n### 特点\n\n而Image提供了四种ImageType：Simple（普通）、Sliced（切割）、Tiled（平铺）、Filled（填充），而且它还是布局元素（ILayoutElement），可以被各种布局组（ILayoutGroup）所包含，将它和其他布局元素进行布局。\n\n### 属性\n\nSource Image：只支持Sprite类型的图片\nColor：给图片混合上颜色\nMaterial：材质(一些特殊情况需要使用材质)\nRaycast Target：是否接收射线检测\nImage Type：图片类型(普通，九宫切图，平铺，填充)\nPreserve Aspect：是否保持宽高比\nSet Native Size：设置元素为原本的像素大小\n\n#### Image Type\n\n##### Simple\n\n随意拉伸，会变形，可以勾选上PreserveAspect按原宽高比进行拉伸\n\n##### Sliced\n\n按照Sprite Editor中的九宫格进行拉伸处理\n\n![Alt text](assets/20200103131209912.png)\n\n1，3，7，9区域不会进行拉伸，2和8区域会横向拉伸，4和6区域会纵向拉伸，5区域横纵都会拉伸\n\n##### Tilled\n\n图片本身大小会保持不变，像铺地面砖那样填充满整个Image控件\n\n![Alt text](assets/20200103132414236.png)\n\n##### Filled\n\n图片以不同的方式呈现出来，例如技能冷却，血条，进度条\n\n## Raw Image\n\n> the Image control requires its Texture to be a Sprite\n>  the Raw Image can accept any Texture.\n\n### 特点\n\nraw: 生的，未加工的\n支持任何一种贴图模式，包括Render Texture和Movie Texture\n只为我们提供了修改UV的方法，除此之外都是继承自MaskableGraphic的方法\n\n> DefaultTexture类型会将贴图宽和高转换为2的n次幂\n>  Sprite类型不会对宽和高进行自动拉伸，可以在Inspector—Advanced—Non—Power of 2选择是否进行转换\n\n### 属性\n\nColor\nMaterial\nRaycast Target\nUV Rect：设置UV缩放和偏移(x和y属性用于控制UV左右、上下偏移，W和H属性用于控制UV的重复次数)\n\n> 可以在Import Settings中的Wrap Model设置循环的模式，Repeat模式可以用于2D游戏的背景图循环\n\nSet Native Size：设置元素为原本的像素大小\n\n## Ref\n\n<https://blog.csdn.net/ecidevilin/article/details/52556724>\n[/article/details/103807887?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param”>https://blog.csdn.net/LLLLL/article/details/103807887?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param&depth_1-utm_source=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-3.channel_param](http://\"https://blog.csdn.net/LLLLL<strong)\n"
}
