_numpysurfarray.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:Projects 作者: it2school 项目源码 文件源码
def array_colorkey(surface):
    """pygame.numpyarray.array_colorkey(Surface): return array

    copy the colorkey values into a 2d array

    Create a new array with the colorkey transparency value from each
    pixel. If the pixel matches the colorkey it will be fully
    tranparent; otherwise it will be fully opaque.

    This will work on any type of Surface format. If the image has no
    colorkey a solid opaque array will be returned.

    This function will temporarily lock the Surface as pixels are
    copied.
    """
    size = surface.get_size()
    array = numpy.empty(size, numpy.uint8)
    surface_to_array(array, surface, 'C')
    return array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号