_numpysurfarray.py 文件源码

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

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

    copy pixel alphas into a 2d array

    Copy the pixel alpha values (degree of transparency) from a Surface
    into a 2D array. This will work for any type of Surface
    format. Surfaces without a pixel alpha will return an array with all
    opaque values.

    This function will temporarily lock the Surface as pixels are copied
    (see the Surface.lock - lock the Surface memory for pixel access
    method).
    """
    size = surface.get_size()
    array = numpy.empty(size, numpy.uint8)
    surface_to_array(array, surface, 'A')
    return array
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号