how to show a bitmap?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yun Mao

    how to show a bitmap?

    Hi,
    I have a two dimentional array (by Numeric Python) available, and it
    represent a grayscaled bitmap picture. How to display it? Thank you!


    Yun


  • Diez B. Roggisch

    #2
    Re: how to show a bitmap?

    > I have a two dimentional array (by Numeric Python) available, and it[color=blue]
    > represent a grayscaled bitmap picture. How to display it? Thank you![/color]

    You can use pygame.

    Diez

    Comment

    • Yun Mao

      #3
      Re: how to show a bitmap?

      Could you please be a little more specific? ;)

      Yun


      On Mon, 1 Dec 2003, Diez B. Roggisch wrote:
      [color=blue][color=green]
      > > I have a two dimentional array (by Numeric Python) available, and it
      > > represent a grayscaled bitmap picture. How to display it? Thank you![/color]
      >
      > You can use pygame.
      >
      > Diez
      >[/color]

      Comment

      • Diez B. Roggisch

        #4
        Re: how to show a bitmap?

        Yun Mao wrote:
        [color=blue]
        > Could you please be a little more specific? ;)[/color]

        Its well documented on www.pygame.org. You have to look into the module
        surfarray, which makes it possible to access and manipulate pixel data
        using - guess what - Numeric arrays.

        Look in the code examples for some effects that utilize this - AFAIK there
        is something like a fire or motion blurring. These access pixel data. Just
        plug in your array, and you should be done.

        Regards, Diez

        Comment

        • Diez B. Roggisch

          #5
          Re: how to show a bitmap?

          > Look in the code examples for some effects that utilize this - AFAIK there[color=blue]
          > is something like a fire or motion blurring. These access pixel data. Just
          > plug in your array, and you should be done.[/color]



          This is the flames example. The function in question is blit_array - look it
          up in the docs. This example even deals with indexed_bitmap_ data, which is
          what you want, as you have a only one value per pixel.

          Regards,

          Diez

          Comment

          • Michel Claveau/Hamster

            #6
            Re: how to show a bitmap?





            Comment

            Working...