Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. Clever Code
  4. Bitmap Size

Bitmap Size

Scheduled Pinned Locked Moved Clever Code
graphicscareer
20 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Christian Graus

    It doesn't matter if it's a jpeg, it's of no value until it's turned into a bitmap, in memory.

    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

    K Offline
    K Offline
    KarstenK
    wrote on last edited by
    #11

    I had recently a project with some background graphic elements. I am using jpegs because the need less space and it works fine. I think he has problems to handle big pictures...

    Greetings from Germany

    C 1 Reply Last reply
    0
    • K KarstenK

      I had recently a project with some background graphic elements. I am using jpegs because the need less space and it works fine. I think he has problems to handle big pictures...

      Greetings from Germany

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #12

      Sure, but in memory, they take up as much room as Bitmaps, because they have to BE Bitmaps in order to be drawn.

      Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      J K 2 Replies Last reply
      0
      • C Christian Graus

        Sure, but in memory, they take up as much room as Bitmaps, because they have to BE Bitmaps in order to be drawn.

        Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        J Offline
        J Offline
        John M Drescher
        wrote on last edited by
        #13

        Christian Graus wrote:

        because they have to BE Bitmaps in order to be drawn.

        Not if you use directdraw but I guess you would want to uncompress the whole image for drawing in that case as well.

        John

        1 Reply Last reply
        0
        • C Christian Graus

          Sure, but in memory, they take up as much room as Bitmaps, because they have to BE Bitmaps in order to be drawn.

          Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          K Offline
          K Offline
          KarstenK
          wrote on last edited by
          #14

          Really??? Isnt that a task which will do the Graphic card with its driver, and only process the need (partial) area? :confused:

          Greetings from Germany

          C 1 Reply Last reply
          0
          • J Jim Warburton

            There is a size limit on bitmaps in VS2005 of 32767 (signed 2^16) pixels height and width, that is hard coded by Microsoft. I could find no documentation indicating it existed. Microsoft did admit it was there. Microsoft's response to queries about changing the limit to a default and allowing the user to set a higher limit or hard coding a higher limit... What are you smoking need a bitmap that size and unless more complaints come in we are going to nothing. Jim "You don't like it here, why don't take a job wrapping tomatoes" Rohan

            J Offline
            J Offline
            Jim Warburton
            wrote on last edited by
            #15

            The files are generally in the 155 meg range, but can be from 125-260 meg. The pixel range is typically 5000-7000 by 15000-20000. It is an ocean seismic return, so each line of vertical pixels (a trace) is one sound shot and each pixel on that line is a return. The number of returns depends on the sampling frequency and the frequency of the sound (how far below ground a good return can come from) and the number of traces on how long the ship ran on one line and how often a shot was made. The want/need to zoom is asked for. If you double 20000 the bit map size is exceeded. At the moment the drawing is done on a pictureBox, which turns out not to be so bad as changing the bitmap is VERY bad. At the moment it is looking like the geologists will not be able zoom past 32000, as that is a simple fix. Time/money thing. Jim "You don't like it here, why don't take a job wrapping tomatoes" Rohan

            M 1 Reply Last reply
            0
            • K KarstenK

              Really??? Isnt that a task which will do the Graphic card with its driver, and only process the need (partial) area? :confused:

              Greetings from Germany

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #16

              If you're just using forms, to draw your image you'll need code like this: Bitmap bm = Bitmap.FromFile("myfile.jpg"); At this point the image has been loaded and takes as much room in memory as if it was a bmp.

              Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

              K 1 Reply Last reply
              0
              • P peterchen

                You were right until here:

                John Crenshaw wrote:

                It would take them like 2 minutes to convert their decade old 16 bit size bytes to the 64 bit numbers of the new millennium.


                We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
                My first real C# project | Linkify!|FoldWithUs! | sighist

                J Offline
                J Offline
                John Crenshaw
                wrote on last edited by
                #17

                Perhaps, but following the standard that they usually do for reverse compatibility, it would probably be very easy. Duplicate the structure and related code, convert the shorts that they are using to 64bit integers everywhere (trivial, how often do you REALLY use a short?) Put an Ex on the end of all the APIs so they don't break anything. Of course recompiling might be interesting. And any MS employee will loyally exclaim, "Oh the cost...and the testing...and the time...and the cost...and the cost...and heaven forbid we might break something..." Ignore the fact that they have money to blow on pattenting boxes of unpatentable garbage. Forget the fact that everything is late anyway. NM the fact that when testers report a bug, it gets the same treatment this one got. Don't bother with the statistics. Vista breaks 8% of XP software products AT IT'S BEST (figures from Microsoft.) What do they care about cost, time, testing, and breaking things? They only care when it's a good excuse to not listen to testers, or leave something broken. Like this. Sorry, I'm in a bad mood tonight.:mad: 3rd party might be an issue, I never thought of that, good point.

                S 1 Reply Last reply
                0
                • J John Crenshaw

                  Perhaps, but following the standard that they usually do for reverse compatibility, it would probably be very easy. Duplicate the structure and related code, convert the shorts that they are using to 64bit integers everywhere (trivial, how often do you REALLY use a short?) Put an Ex on the end of all the APIs so they don't break anything. Of course recompiling might be interesting. And any MS employee will loyally exclaim, "Oh the cost...and the testing...and the time...and the cost...and the cost...and heaven forbid we might break something..." Ignore the fact that they have money to blow on pattenting boxes of unpatentable garbage. Forget the fact that everything is late anyway. NM the fact that when testers report a bug, it gets the same treatment this one got. Don't bother with the statistics. Vista breaks 8% of XP software products AT IT'S BEST (figures from Microsoft.) What do they care about cost, time, testing, and breaking things? They only care when it's a good excuse to not listen to testers, or leave something broken. Like this. Sorry, I'm in a bad mood tonight.:mad: 3rd party might be an issue, I never thought of that, good point.

                  S Offline
                  S Offline
                  Shog9 0
                  wrote on last edited by
                  #18

                  John Crenshaw wrote:

                  Perhaps, but following the standard that they usually do for reverse compatibility, it would probably be very easy. Duplicate the structure and related code, convert the shorts that they are using to 64bit integers everywhere (trivial, how often do you REALLY use a short?) Put an Ex on the end of all the APIs so they don't break anything.

                  Heh. What you're describing is a new format, complete with new APIs to support them, all to support the relatively small population of developers who 1) need large bitmaps and 2) would prefer to use Microsoft's bitmap APIs rather than write their own. There's no hope of backwards compatibility, a very slim chance that most popular bitmap programs will be re-written to use a MS-specific large bitmap format anytime soon, and just about 0 chance that the average user will be understanding when their Win2k/XP machine crashes while trying to open .BMP files sent to them by their Vista using friends... I disagree with a lot of what MS is up to, but even i can't see how they could justify such a lost cause. ;)

                  ----

                  It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.

                  --Raymond Chen on MSDN

                  1 Reply Last reply
                  0
                  • C Christian Graus

                    If you're just using forms, to draw your image you'll need code like this: Bitmap bm = Bitmap.FromFile("myfile.jpg"); At this point the image has been loaded and takes as much room in memory as if it was a bmp.

                    Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

                    K Offline
                    K Offline
                    KarstenK
                    wrote on last edited by
                    #19

                    Ofcourse, if you do THIS. But I use for jpg the IPicture COM-Interface which isnt AFAIK a Bitmap. I think dont make a (complete) bitmap in memory is the solution.

                    Greetings from Germany

                    1 Reply Last reply
                    0
                    • J Jim Warburton

                      The files are generally in the 155 meg range, but can be from 125-260 meg. The pixel range is typically 5000-7000 by 15000-20000. It is an ocean seismic return, so each line of vertical pixels (a trace) is one sound shot and each pixel on that line is a return. The number of returns depends on the sampling frequency and the frequency of the sound (how far below ground a good return can come from) and the number of traces on how long the ship ran on one line and how often a shot was made. The want/need to zoom is asked for. If you double 20000 the bit map size is exceeded. At the moment the drawing is done on a pictureBox, which turns out not to be so bad as changing the bitmap is VERY bad. At the moment it is looking like the geologists will not be able zoom past 32000, as that is a simple fix. Time/money thing. Jim "You don't like it here, why don't take a job wrapping tomatoes" Rohan

                      M Offline
                      M Offline
                      miennaco
                      wrote on last edited by
                      #20

                      It would help if you separated the Model/View in your head. The data is a 2 dimensional array of depth information. The view is the screen sized zoom the user is looking at. What you want is a bitmap extract function that can run at multiple zoom levels. There is a transition in the extraction algorithm at 1 to 1. It switches from multiple pixels per point to multiple points per pixel. You can probably insist on powers of 2 zoom levels. The big advantage of this is you only extract the bitmap you are actually going to display. My suggestion is that you use a semi-proprietary file form for the data, XML if file space is not an issue, something binary and compressed if it is. The format should allow at least one thumbnail to be attached. You can argue about what to attach, but an overall zoom to a small view (say 200x600) would probably me most useful for selecting files from a list. The file loader will create the needed array in memory (model), not an actual bitmap (view). Combining the model/view is a standard design error that routinely causes massive long term problem as you restrict the available metadata to what the view format will support.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups