Announcement

Collapse
No announcement yet.

chopping up a bitmap

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

  • chopping up a bitmap

    Is there a slick way of chopping up a bitmap into little bitmaps?

    My guess is that it will be quicker to draw a single bitmap then chop it up ( a number of symbols to use in a menu), rather than to draw each symbol in a new DC. But maybe I'm wrong...??

  • #2
    Just for clarification: Are you talking about thumb-nails or checkerboarding?
    There are no atheists in a fox hole or the morning of a math test.
    If my flag offends you, I'll help you pack.

    Comment


    • #3
      VB, et.al. sometimes refer to this as a picture clip. It is really straight forward to do in 1 of 2 ways:
      (1) all pieces to be clipped are the same size, only need to code that size
      (2) a montage of different sizes, needs their locations and sizes available for the program.

      In case 1, a regular size, the program can calculate the offset and extract the needed bitmaps. I recently posted an example that does something like this Here
      I have another program that can take a bitmap and chop and save into individual files. If the above referenced link and files there do not point you in the desired direction, then let me know and I'll go try and dig up this latter code.
      Last edited by Richard Angell; 19 Sep 2008, 01:52 PM.
      Rick Angell

      Comment


      • #4
        Originally posted by Mel Bishop View Post
        ...thumb-nails or checkerboarding?
        Not quite sure what checkerboarding means in this case but I'm not using thumbnails. The big bitmap contains a number of equally-sized drawn objects - lines of different styles in fact - and I will feed each one in to a menu as a seperate option using SetMenuItemBitmaps.

        Comment


        • #5
          Originally posted by Richard Angell View Post
          (1) all pieces to be clipped are the same size, only need to code that size
          That's the one. I see that you use GRAPHIC commands to do it, I have not used them yet, (the drawing is just done with Moveto/Lineto), will try it out.

          Thanks!

          Comment


          • #6
            My guess is that it will be quicker to draw a single bitmap then chop it up ( a number of symbols to use in a menu), rather than to draw each symbol in a new DC. But maybe I'm wrong...??
            If these are the same symbols over and over, why not just create the master bitmap, store in a resource and retrieve from there?
            Rick Angell

            Comment


            • #7
              Originally posted by Richard Angell View Post
              If these are the same symbols over and over, why not just create the master bitmap, store in a resource and retrieve from there?
              that's a possibility, but it will still need to be split up. Or I could store all 16 as seperate bitmaps in the resource, which would save on coding!

              Comment


              • #8
                Yes.

                Putting them in a resource is easy enough. The example I used was done showing a technique used for some games that use character strips as I explained.
                Rick Angell

                Comment

                Working...
                X