zoukankan      html  css  js  c++  java
  • X Window研究笔记(19)

    X Window研究笔记(19)

    转载时请注明出处和作者联系方式
    作者联系方式:李先静 <xianjimli at hotmail dot com>

    19.X Window中的图片文件Pixmap

    X Window自己定义了一种图片文件格式,叫做pixmap,与众不同的是,它完全以文本文件格式存放图片内容,而不是采用通常的二进制格式。下面一个图片的例子:

    static char* Busy1[] = {
    "32 32 6 1 15 16",
    "  c None",
    "! c #101010",
    "# c #C0C0C0",
    "$ c #808080",
    "% c #000000",
    "& c #FFFFFF",
    "                                ",
    "                                ",
    "                                ",
    "                                ",
    "        !!!!!!!!!!!!!!!         ",
    "        %%%%%%%%%%%%%%%         ",
    "         !&&&&&&&&&&&!          ",
    "         !&&&&&&&&&&&!          ",
    "         !&&&&&&&&&&&!          ",
    "         !$$&$&&&$&$!!          ",
    "         !$$$$%&%!$!$!          ",
    "          !$$$!$!!!$!           ",
    "           !&$$!$$$!            ",
    "            !$$$!$!             ",
    "             !$$$!              ",
    "              !$!               ",
    "              !$!               ",
    "             !$&$!              ",
    "            !$&$&$!             ",
    "           !$&&$$&$!            ",
    "          !$&&&$#&&$!           ",
    "         !$&&&#$##$&!!          ",
    "         !&&&&&$&#&&&!          ",
    "         !&&&&$$$&$&$!          ",
    "         !&&&$$!&$&&&!          ",
    "         !$$$$!%!$!$!!          ",
    "        %%%%%%%%%%%%%%%         ",
    "        !!!!!!!!!!!!!!!         ",
    "                                ",
    "                                ",
    "                                ",
    "                                "}
    ;


    (怎么样,它还反应出实际图片的形状呢。)

    这种图片文件的好处在于它是文本格式的,具有更好的可移植性,不用考虑字节顺序和对齐的问题,它的限制在于它的体积庞大,也不适用于存放颜色数多的图片。

    (待续)


     
  • 相关阅读:
    动态规划总结(01背包 完全背包 多重背包)
    HDOJ(HDU).2844 Coins (DP 多重背包+二进制优化)
    HDOJ(HDU).1059 Dividing(DP 多重背包+二进制优化)
    HDOJ(HDU).2191. 悼念512汶川大地震遇难同胞――珍惜现在,感恩生活 (DP 多重背包+二进制优化)
    HDOJ(HDU).2159 FATE (DP 带个数限制的完全背包)
    HDOJ(HDU).4508 湫湫系列故事――减肥记I (DP 完全背包)
    HDOJ(HDU).1284 钱币兑换问题 (DP 完全背包)
    HDOJ(HDU).1114 Piggy-Bank (DP 完全背包)
    HDOJ(HDU).3466 Dividing coins ( DP 01背包 无后效性的理解)
    POJ.3624 Charm Bracelet(DP 01背包)
  • 原文地址:https://www.cnblogs.com/zhangyunlin/p/6167668.html
Copyright © 2011-2022 走看看