No announcement yet.

Max size of graphic bitmap?

  • Filter
  • Time
  • Show
Clear All
new posts

  • Max size of graphic bitmap?

    I want to create some pretty large bitmaps to be sent to a high res printer. I find GRAPHIC BITMAP NEW fails to create a handle at something less than 8000 by 8000. What limit am I running into- memory? Something else? I'd really like to fill a 8x10.5 page at 1200dpi, so 9600 by 12600 would be ideal. That may seem large, but it's pretty common in my photo/graphics world.

  • #2
    On my pc (1GB of RAM, page size 3GB) this code stopped at 5200 x 5200.
    Function PbMain()
     Dim x&, hBmp???
        Sleep 1
        x = x + 100
        GRAPHIC BITMAP NEW x, x TO hBmp
        If hBmp >0 Then
          GRAPHIC Attach hBmp, 0
          GRAPHIC Bitmap End
          Iterate Loop
          Exit loop
        End If
      MsgBox "Bitmap New failed at "+str$(x)+" x "+str$(x),,"Result"
    End Function
    Last edited by Dave Biggs; 10 Jan 2009, 11:17 PM.
    Rgds, Dave


    • #3
      I didn't go looking for the exact size before, but with your code it's 6200 x 6200. I have 2G of RAM, but the video takes about 0.5, plus XP, leaving a bit under 1G to play with. If a graphic bitmap is 8 bits/color, that's 6200*6200*8*3 = 922560000 bits or 115320000 bytes or 112.6 MB. Is that right (my math is always suspect) or am I missing something else that contributes to size or limitations?

      Last edited by Conrad Hoffman; 11 Jan 2009, 10:33 AM.


      • #4
        Maybe you can create multiple smaller bitmaps and just print 'em separately but adjacent?
        Michael Mattias
        Tal Systems (retired)
        Port Washington WI USA
        [email protected]


        • #5
          You are limited by actual graphics (video) memory with DDBs (Device Dependent Bitmap). If you are NOT using GDI calls on the bitmap, allocate it as a DIB (Device Independent Bitmap, or "memory bitmap") and use the APIs DIB functions to manage it. DIBs are handled in RAM, which has a 2GB limit under Win32, so you should be safe.

          I think the GRAPHIC statements offered by the compiler use DDBs but you'd have to verify that with PB's support dept.
 | Slam DBMS | PrpT Control | Other Downloads | Contact Me


          • #6
            MCM, that's definitely possible. Some of the things I'm drawing are circular, so I could just mirror the data of a single quad to get the whole thing. For other objects, it's more difficult, but doable.

            Kev, it never would have occurred to me that the bitmap was being done in video memory before it got copied for display, but now it makes sense and explains a lot.

            Drifting away a bit, when I print using XPRINT statements, is it just like working with a bitmap, that is, can I do anything I want with the pixels, multiple times, overwriting, whatever and nothing is finalized and printed until I issue XPRINT CLOSED?