Announcement

Collapse
No announcement yet.

PB and Graphics Files..

Collapse
X
 
  • 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
    http://www.explore-rpg.com
    Explorations v9.10 RPG Development System
    http://www.explore-rpg.com

  • #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: http://www.powerbasic.com/support/pb...ead.php?t=3704)

    regards
    peter


    ------------------


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

    Comment


    • #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.

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

      Comment


      • #4
        Go to http://www.openil.org

        and get http://download.sourceforge.net/open...ler-2.1.4b.exe

        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

        Comment


        • #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.
          Code:
          hWnd = CreateWindow( "STATIC", $NUL, %WS_CHILD OR %WS_VISIBLE OR %SS_BITMAP, nX, nY, _
          nWidth, nHeight, hWndParent, nID, hInstance, %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.

          Comment

          Working...
          X