Announcement

Collapse
No announcement yet.

PNG Images

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • PNG Images

    Hello! This is my first post here.

    I don't have PowerBASIC yet, but the answer(s) to this question
    might determine whether I get it.

    What is needed (in general terms, not code or even pseudocode)
    to load and display PNG graphic images with PowerBASIC?

    -- Leonard

  • #2
    You can use GDI+ to load PNGs.

    DECLARE FUNCTION GdipLoadImageFromFile LIB "gdiplus.dll" ALIAS "GdipLoadImageFromFile" (BYVAL FilName AS STRING, nImage&) AS LONG

    Patrice has an include file for the GDI+ flat API available for purchase at:
    http://www.zapsolution.com/winlift/index.htm

    Or his GDImage library is very nice.

    Here' some pseudo code:

    Code:
    GdiplusStartup ByRef GDIpHandle <---- Intialize GDI+
    GdipLoadImageFromFile "MyPNG.png", ByRef ImageHandle <----- Load PNG
    GdipCreateFromHDC WindowDC, ByRef GraphicHandle <------ Create Graphic from Windows DC
    GdipDrawImageI GraphicHandle, ImageHandle, X, Y <---- Draw Image
    GdipDeleteGraphics GraphicHandle <---- Delete GraphicsHandle from memory
    GdipDisposeImage ImageHandle <------ Delete Image from Memory
    GdiplusShutdown GDIpHandle <---- Shut down GDI+
    That's just a Pseudo Code example
    Last edited by RyanCross; 27 Nov 2007, 10:37 AM.
    Thank you,
    Ryan M. Cross

    Comment


    • #3
      Hi Leonard,

      I've been using GDI+ for my imaging for the past couple of years and it works great.
      C'ya
      Don

      http://www.ImagesBy.me

      Comment


      • #4
        I gather, first, that when you say "GDI+" you mean "gdiplus.dll".
        And second, that gdiplus.dll works with Windows 2000, XP, and
        Vista, but not Windows 98 or ME. And third, that gdiplus.dll is
        included in XP and Vista but not in Windows 2000. Is that right?

        Is there a DLL available for reading .png images that works under
        Windows 98 and ME?

        -- Leonard

        Comment


        • #5
          gdiplus.dll comes as redistributable.

          PS, windows 98 is obsolete.. move on
          hellobasic

          Comment


          • #6
            http://www.microsoft.com/downloads/d...displaylang=en
            hellobasic

            Comment


            • #7
              AIUI Windows 98 or ME will work with GDI+, but you have to get the re-ditributable first. And it also will work with W2K. The re-ditributable is free.
              Rick Angell

              Comment

              Working...
              X