CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    82

    problem with comparatible bitmap

    I drew things in DC and wanted to create a comparatible bitmap as follows:
    BOOL bSucced = bmp.CreateCompatibleBitmap(&dc, width, height);
    But when I set the width and height more than 10,000 * 3,000 (I have special use for a so big bitmap) , the function returned false. Is the function has some limit for the dimension of the bitmap?

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    Which Windows?
    On Windows 9X, a bitmap object is limited to 16MB.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176
    There is also another limit: when the size of your bitmap exceeds the size supported by videocard (smth about max screen resolution or not too much greater), every operation with bitmap requires times more time as operations with such a bitmaps are not supported by hardware and use software emulation. The disadwantage of this limit is that this limit is a limit on LINEAR dimentions of a bitmap, not its area, so (where I first met it) it you create a big array of images in a single bitmap, you need to shift images in rows, the single row can require to big width dimension.
    "Programs must be written for people to read, and only incidentally for machines to execute."

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    Quote Originally Posted by RoboTact
    ...when the size of your bitmap exceeds the size supported by videocard (smth about max screen resolution or not too much greater), every operation with bitmap requires times more time as operations with such a bitmaps are not supported by hardware and use software emulation....
    Do you have any references to documentation about this?
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  5. #5
    Join Date
    Jun 2002
    Location
    Moscow, Russia.
    Posts
    2,176
    No, I just tested it by myself... Can you give another explanation to the fact that, say, when performing some simple drawing at bitmap with any width less them some value, it requires, say, 1 minute, and if you add 1 pixel to its width, it requires 10 minutes? And requires the same time with any other greater size (so, there is no relation with bit structure of width field).
    "Programs must be written for people to read, and only incidentally for machines to execute."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured