9 Replies Latest reply on Dec 27, 2006 10:40 AM by Katie_Fleming

    Bounding Box Question

    Katie_Fleming
      Ok I have run into the simplist problem yet I can't figure it out. I have a menu I'm working on, and I saved one of the buttons as a png from Photoshop. I imported it, however the bounding box in Director shows it to be the size of the stage, instead of just around the text. I've tried re-saving the png a couple times, but the bounding box is still not only surrounding the button. Do any of you know what's going on? How to fix it?

      Thanks!
        • 1. Re: Bounding Box Question
          James Newton, ACP Level 3
          It sounds as if, when you imported it, you cleared the checkbox that says "Trim white space".
          If this is the case:

          1. Open the bitmap member in the Paint window
          2. Open the Property Inspector at the Bitmap tab
          3. Make sure that the Trim checkbox is selected
          4. Select the entire bitmap: a shortcut is to double-click on the selection tool in the Paint window
          5. Cut the bitmap
          6. Paste it back into the Paint window

          If nothing happens at step 5, it may be because Director is unwilling to edit an imported image. To convince Director to do what you want, select part of the image and attempt to move it (or perform any of a number of edit actions). This will prompt Director to show you a dialog where you can choose to Continue editing the image. Once you have confirmed your intentions and the dialog has closed, repeat step 5 and go on to step 6.

          Does this resize the bounding box?
          • 2. Re: Bounding Box Question
            Katie_Fleming Level 1
            Hey there, thanks for the help. Unforunately it's not working! I opened the image in the paint window, but unforunately I can't see it because it's white text. I double clicked to see where the registration point was and tried the cutting/pasting method from there but it doesn't re-size the bounding box unforunately.

            I have never run into this problem before...quite strange. Any other ideas? I'm completely stuck on this one!
            • 3. Re: Bounding Box Question
              James Newton, ACP Level 3
              It sound as i you've got white text on a white background. If this is the case, then the real data is in the alpha channel which defines which parts of the all-white image are transparent and which are opaque.

              You could try this:

              vBitmap = member("Name of your image with white text")
              new(#bitmap).image = TrimWhiteOnWhite(vBitmap)

              (See below for the TrimWhiteOnWhite() handler).

              This will create a new bitmap with the smallest viable rect, where you will be able to distinguish the transparent and the non-transparent areas, even in the Paint window. You could use this new bitmap instead of the oversized original.

              If this does not address your issue then you could try either providing more details, or simply re-importing your graphic.


              • 4. Bounding Box Question
                Katie_Fleming Level 1
                Hmm...it doesn't seem to be working for me. I've never run into this problem before, it's so weird.

                I already have one button which was white text imported and it works no problem (with all 3 rollover states)

                When I import the images I un-check Trim White Space, because when I import it without that selected, I can't see the text at all.

                I'm not sure how else to explain it. Would sending the file be easier? I appreciate your help.

                EDIT: Ok I took a look at the button that was working. I had a drop shadow/outer glow on it. (And that one worked) So I applied the same effect to the button I'm trying to get working, re-imported, and now the bounding box is fine. Very weird...but at least now I know how to fix it. Guess Director doesn't like plain white images? Hmm....

                :)
                • 5. Re: Bounding Box Question
                  Level 7
                  Perhaps it would be easier to open your image in Photoshop (or whatever
                  image editing program you like). Crop this button to the correct size.
                  Save it and import that into Director.
                  • 6. Re: Bounding Box Question
                    Katie_Fleming Level 1
                    That would work, but I need the button positioned in a specific spot...and because I have the rollover effects it would mess it up!
                    • 7. Re: Bounding Box Question
                      Level 7
                      On Wed, 27 Dec 2006 17:03:04 GMT, Katie_Fleming posted in
                      macromedia.director.basics:


                      > When I import the images I un-check Trim White Space, because when I
                      > import it without that selected, I can't see the text at all.

                      I suspect it will work if, in your graphics editor, you set the text to off
                      white. Most people can't tell the difference between rgb(255,255,255) and
                      rgb(254,254,254) or #FEFEFE.



                      --
                      Mark A. Boyd
                      Keep-On-Learnin' :)
                      • 8. Re: Bounding Box Question
                        Level 7
                        On Wed, 27 Dec 2006 18:13:34 GMT, Mark A. Boyd posted in
                        macromedia.director.basics:

                        > On Wed, 27 Dec 2006 17:03:04 GMT, Katie_Fleming posted in
                        > macromedia.director.basics:
                        >
                        >
                        >> When I import the images I un-check Trim White Space, because when I
                        >> import it without that selected, I can't see the text at all.
                        >
                        > I suspect it will work if, in your graphics editor, you set the text to
                        > off white. Most people can't tell the difference between
                        > rgb(255,255,255) and rgb(254,254,254) or #FEFEFE.

                        Or maybe if you import the files into Fireworks and save them as Fireworks
                        PNG files (the default).



                        --
                        Mark A. Boyd
                        Keep-On-Learnin' :)
                        • 9. Re: Bounding Box Question
                          Katie_Fleming Level 1
                          Thanks! I'll give that a try -- and you're right about the off-white vs white. Thanks!