No announcement yet.

PB and Graphics Files..

  • Filter
  • Time
  • Show
Clear All
new posts

  • PB and Graphics Files..

    Some users on PB has suggested I convert my game application to 100%
    PowerBasic. I have a series of questions about PB and graphics in general.

    1. If I were writing the game for PB/DOS .EXE how would I set graphics
    mode in PB?

    2. If I remain under windows. How could I load graphics file. (.BMP, .GIF, .JPG)
    Are there any PB routines already available to handle this?

    Explorations v3.0 RPG Development System
    Explorations v9.10 RPG Development System

  • #2
    under windows you can load bmp's with loadimage.
    from win98 and nt 5.0 you should also be able to load jpeg's.
    gif's are more problematic! (see my post:



    [this message has been edited by peter p stephensen (edited may 07, 2001).]
    [email protected]


    • #3
      Regarding your PB/DOS comment... you would use the usual PB/DOS SCREEN statement, which supports up to screen 12.

      There are libraries in the DOWNLOADS section for Mode-X and Vesa graphics modes too.

      However, this is really off-topic for this forum... posting PB/DOS enquiries in the PB/DOS forum will probably net you a greater response from *active* DOS programmers!

      Without knowing your experience with Windows graphics programming, I have to point out that there are tremendous differences between graphics programming in Windows and DOS... a good Windows programming book can be worth it's weight in gold, especially if you want to go the API route for Windows graphics programming.

      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      mailto:[email protected]


      • #4
        Go to

        and get

        It's a free OpenSource image library that handles a lot of formats.
        It comes with PB headers and samples.
        You are free to use it for commercial applications too (Licence LGPL)

        Best Regards
        Peter Scheutz
        Best Regards
        Peter Scheutz


        • #5
          How could I load graphics file. (.BMP, .GIF, .JPG)
          Are there any PB routines already available to handle this?
          If you only need to display bitmap images, you could use a static control created with the bitmap style, e.g.
          [i]hWnd[/i] = CreateWindow( "STATIC", $NUL, %WS_CHILD OR %WS_VISIBLE OR %SS_BITMAP, [i]nX[/i], [i]nY[/i], _
          [i]nWidth[/i], [i]nHeight[/i], [i]hWndParent[/i], [i]nID[/i], [i]hInstance[/i], %NULL )
          You may need to add other styles as required. You then load the image from a resource or file using LoadBitmap() or LoadImage() and tell the static control to display it by sending it a STM_SETIMAGE message.

          Using GIF images is somewhat more complicated. The issues involved are explained in MS KB article #Q193543.

          [This message has been edited by Matthew Berg (edited May 07, 2001).]
          If you try to make something idiot-proof, someone will invent a better idiot.