Picture box container

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • akynaya
    New Member
    • Jul 2007
    • 27

    Picture box container

    I have several image boxes... and one picture box as a container...


    The problem is that... when i try to save the images.... the images doesn't appear.


    for the image box code

    i used LoadPicture

    as for the Picture box....

    i dont have any idea yet on how to be able to save the image boxes.. with the picture box as their container.


    does anyone know how to do this?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    What version of VB are you using?

    In any case, as far as I know the type of container that holds an image box should make no difference to how it works.

    Comment

    • akynaya
      New Member
      • Jul 2007
      • 27

      #3
      Originally posted by Killer42
      What version of VB are you using?

      In any case, as far as I know the type of container that holds an image box should make no difference to how it works.
      Im using VB6.... if you have any idea... i would gladly try it.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by akynaya
        Im using VB6.... if you have any idea... i would gladly try it.
        I must admit, this is an area where I've always been a little vague. Sometimes you have to use the .Picture property, sometimes .Image, and the settings of certain properties such as .AutoRedraw also have an effect.

        Also, I'm not entirely certain I understand the problem in detail. Are you saying that you have a number of imagebox controls, which reside in a picturebox control, and you are not getting what you expect when you save the images from them? And by "save" I mean writing to disk, with something like the SavePicture function.

        Comment

        • akynaya
          New Member
          • Jul 2007
          • 27

          #5
          Yes, exactly... that is my problem.. i've been trying to find other similar problems but to no avail... i haven't found anything...


          do you have any idea on how to do this?

          Thank you for the help

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by akynaya
            ... do you have any idea on how to do this?
            Are you placing the images in the imagebox controls at design time or run time, or is your code drawing them? Can you show us the code used to load/draw/save the images?

            Comment

            • akynaya
              New Member
              • Jul 2007
              • 27

              #7
              im placing the image boxes at design time... i've set the visibility under false and stretch property to true as to enable the image to be resized during run time.

              when the user clicks on the command button at run time the image boxes' property is set to visible =true.

              here's the commands in the command button:

              Private Sub Command1_click( )
              Dim as as integer
              if as < 5 then
              Image1(as).pict ure = LoadPicture("pa thname/file name of pix")
              Image1(as).visi ble=True
              End if

              The image boxes is arrayed..

              The code for the image boxes are simply for the drag and drop methods and the resizing event...

              The code for saving that i've used is

              .SavePicture Picture1.Image ....

              hope this helps

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Ok, so let me see if I've got this right. You've placed a bunch of imagebox controls inside a picturebox control. At run time, you load a picture into one or more of the imagebox controls. Then you save the image/picture (whatever you want to call it) from the picturebox control, and you expect to save what was displayed by the imageboxes.

                If so, then forget it. This scenario has not placed anything in the picturebox controls Picture or Image properties. If you place an image in an ImageBox, then to save it you have to save it from the ImageBox.

                Comment

                • akynaya
                  New Member
                  • Jul 2007
                  • 27

                  #9
                  Yes, that's right... but i was wondering how come some other programmers are able to use picture boxes as a container using shapes?

                  i am wondering if all those image boxes could be repaired and instead of a big picture box as a work area.... could a big image box be able to save those other images?


                  if not, can you give me a better alternative to this?

                  Comment

                  • Killer42
                    Recognized Expert Expert
                    • Oct 2006
                    • 8429

                    #10
                    As far as I can see, you have two real options.
                    • You can save the contents of each ImageBox, or
                    • You could try using the PaintPicture method to paint a copy of your ImageBox controls onto the PictureBox, then save it.

                    Comment

                    • akynaya
                      New Member
                      • Jul 2007
                      • 27

                      #11
                      would you know how to do this?
                      if i save each of the image boxes?

                      and if i did a paintpicture method, can you give me an example on how to do it?

                      thank you..

                      im sori if i am giving you a hard time

                      Comment

                      • Killer42
                        Recognized Expert Expert
                        • Oct 2006
                        • 8429

                        #12
                        Originally posted by akynaya
                        would you know how to do this?
                        if i save each of the image boxes?
                        The same way you planned to save the picturebox.

                        Originally posted by akynaya
                        and if i did a paintpicture method, can you give me an example on how to do it?
                        Picture1.PaintP icture Image1.Picture, Image1.Left, Image1.Top

                        Comment

                        • akynaya
                          New Member
                          • Jul 2007
                          • 27

                          #13
                          OK.. thank you... i'll try out what you've said..

                          Comment

                          Working...