Page 1 of 2 12 LastLast
Results 1 to 40 of 41

Thread: [RESOLVED] In need of some help: PictureBox Loop Saving...

  1. #1

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Resolved [RESOLVED] In need of some help: PictureBox Loop Saving...

    I am writing some source code, that needs to save a Bitmap from a PictureBox. But also there are about one hundred channels, and then there are also one hundred sprite channels in the Score of the Dialog Box.

    This means that there are about one thousand different PictureBoxes, that need to keep data in them. However only a screen of them have been designed at design time. But to save, data and time of loading. I have only made one screen, therefore when the user scrolls with the scrollbars. Then they are moved up and down or left and right on the screen.

    I am trying to work out a For .... Next loop, to save them in their different PictureBoxes and their Arrays...

    In the Bitmap, packed with this post. You can see, what I am trying to work out here. I have tried to simplify this as much as possible...

    !! Thanks in advance !!
    Last edited by ThEiMp; Nov 2nd, 2010 at 08:52 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  2. #2
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: In need of some help: PictureBox Loop Saving...

    Not too sure I understand what you're trying to do since you've only shown the picture,not the code.

    I assume you have a PictureBox control array and a set of bitmaps that will populate the Picture properties. At some, as yet undefined, point you want to Save the Pictures somewhere or do you just want to 'remember' which picture was in which PictureBox?

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: In need of some help: PictureBox Loop Saving...

    VB has a limitation on the number of controls that you can use in a form. (I didn't remember the count).

    I think you should redesign the structure in a wise manner. And also, most of the users are having different screen resolutions. When you design your form in a larger resolution and the client's screen is smaller than that, it will be a failure to your program. So, you need to consider the form resizing based on the end user's screen resolution, if you are going to use a large number of controls (as in the above pic) ...

    Good luck...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: In need of some help: PictureBox Loop Saving...

    Over 1000 pictureboxes? I would reconsider a redesign. You may have problems running the application on any older machines. Each picturebox is a window that takes resources. Each image in a picturebox is a resource (unless shared) and if AutoRedraw is true, each will create a hDC and bitmap. You very well may get errors failing to create Active-X objects or run out of memory.

    Though quite a bit harder, you might consider drawing directly to the form or using a single picturebox per row, redrawing the image(s) as needed when the scrollbar is moved. Just an idea.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  5. #5

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Well, I was writing for a 64Mb memory app. But 128Mb is also very nice, in deed. But in Macromedia Director 4.00: It has the same thing, but more controls in the Score. It had 150 sprite channels and then maybe unlimited in the size of frames that it had.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  6. #6

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Is this the source code???
    Code:
    Dim i As Long
    
    For i = 1 to 1
         Form1.txt_SaveData1.Text = Form3.Channel1(0).Name & vbcrlf & Form3.Channel1(0).Picture & vbcrlf & .................
    Next i
    !! Thanks in advance !!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  7. #7
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: In need of some help: PictureBox Loop Saving...

    No...!

    An example is:
    Code:
    Option Explicit
    
    Dim X As Single
    
    Private Sub Command1_Click()
        Dim i As Long
        
        For i = 1 To 5  '~~~ Display 5 copies of the same image in Picture2 (from Picture1)
            Picture2.PaintPicture Picture1.Picture, X, 0
            X = X + Picture1.Picture.Width
        Next
    End Sub
    
    Private Sub Form_Load()
        X = 0
        Picture1.Picture = LoadPicture("c:\mypic.jpg")
    End Sub
    (This is not a perfect example)
    ....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  8. #8
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    I agree with what was said above, you don't need that many picture boxes. Set the max of the scrollbar to the number of pictures you have. Then you can show as many pictureboxes that fit on the screen (you can determine this in the resize event). Then fill all the pictureboxes. When the scroll bar is clicked, just change the pictures in them.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  9. #9

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    That is what I am doing...

    The PictureBoxes don't move, but it is their contents of data that move instead. But I have made a limit of how many moves they can do, to limit the amount of memory, being used for the project. Also the amount of disk space being used by the project.

    Also: How would I go about only sending the .Name, .Index and .Picture of the PictureBoxes that are only in a Control Array. No matter, which Control Array they are in. For example: Picture1.Ubound or Picture2.Ubound up to Picture255.Ubound up until they all have been sent to a TextBox as text data to be saved in a file???
    Last edited by ThEiMp; Sep 2nd, 2010 at 12:56 AM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  10. #10
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    I'm not following you at all.QUOTE=ThEiMp;3875690]The PictureBoxes don't move, but it is their contents of data that move instead.[/QUOTE]

    So how can you have 255 pictureboxes on the form?



    Quote Originally Posted by ThEiMp View Post
    Also: How would I go about only sending the .Name, .Index and .Picture of the PictureBoxes that are only in a Control Array. No matter, which Control Array they are in. For example: Picture1.Ubound or Picture2.Ubound up to Picture255.Ubound up until they all have been sent to a TextBox as text data to be saved in a file???
    To put data in a textbox:
    Code:
    TextBox.Text = Picture2.Ubound
    If thats not what you want please clarify.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  11. #11

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    To seem like it moves to about 255 different PictureBoxes. But it only moves the contents, and the Index value of them, instead.

    -- That was the only way to get it to work, on my side. Also I heard that it happens, quite often in deed...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  12. #12
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    Well I'm not quite understanding you, but if you have a question, I'll do my best to help. If you already asked your question, ask again and pretend you're talking to someone that knows less than you do, explain a lot, in more than one way, and with lots of words.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  13. #13

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    So sorry, about the mix up!!

    Problem: I am trying to save all PictureBoxes in an Control Array on a Form. eg: Picture1.Ubound to Picture255.Ubound. However only if they have something in them, and not if they don't. All I have to save is the: .Name, .Index, .Picture, .Width and the .Height of them.

    .Top and .Left aren't required, because they are only accepted in their controls. I am trying to get something like Macromedia/Adobe Director here...

    -- I hope that clears up everything. If not, then I will try again.
    !! Thanks in advance !!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  14. #14
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    Where do you wish to save the data? Database? File? You can build a boolean array and set it to true when you load a picture. Load a picture in Picture10 then bPicLoadad(10) = TRUE.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  15. #15

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Alright...

    I was going to save it as a text file, with the extension of .dir. Also I am trying to cut corners. By making only nine of the Channels, and then changing their .Index to .Index + 1 or .Index - 1, when the user scrolls the scrollbars.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  16. #16
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    You can't store pictures in a text file. Cjheck out this thread:
    ini or xml; your choice.
    It has code to read from ini files and xml also.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  17. #17

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    But what about this:
    eg:
    Cast Member: #1
    Filename: Hello.tif
    Picture1.Picture
    ===== Break =====
    Cast Member: #2
    Filename: GoodBye.tif
    Picture2.Picture
    ===== Break =====
    Cast Member: #3
    Filename: Hello Again.tif
    Picture3.Picture

    -- Then break them up, when loading them into their separate PictureBoxes, as normal.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  18. #18
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    What about it? You have to explain.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  19. #19

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Can't I do something like that???

    -- That is what Microsoft does with their Visual Basic FRM Files...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  20. #20
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    You have to explain what "that" is. I already told you you can't put a picture in a text file, so I don't understand what you are trying to do unless you tell me.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  21. #21
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    Microsoft does NOT store thier pictures in thier frm files. You are misreading them. They store thier pictures in the frx files.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  22. #22

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    But: I was close...

    -- That is what I am trying to accomplish, but with some kind of fast simple compressed encription. That I have been able to write for my other projects, that are in the same field!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  23. #23
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    Quote Originally Posted by ThEiMp View Post
    -- That is what I am trying to accomplish,
    What trying to do what you said Microsoft does that they don't but I told you anyway they don't what you said, but then you said that.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  24. #24

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Place multipuls of embedded file objects into a single file...

    -- That is what I am trying to accomplish. I am trying to make a programming langague, that works in one project file operation(s).

    Understand???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  25. #25
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: In need of some help: PictureBox Loop Saving...

    See that wasn't so hard. Now I know what you are trying to do. Wish I new several post ago. You have to open the file for binary access, keep track of the length OR store offsets. You will also have to convert the text to binary data; ASC() works well for that. Read up on binary access and try to write out a single entry and when you get that down you can add others.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  26. #26

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    I already know how to do put Binary Access and get Binary Access for data files. I am using that for my passwords, project file save as, project file open/load files, and also compiling the project files to EXE types. So then that means that I have this pretty down pat.

    Problem #1: What is the coding process, to get all the file into a TextBox???
    Problem #2: How to check for any, Bitmaps in a control array of PictureBoxes???
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  27. #27
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: In need of some help: PictureBox Loop Saving...

    Problem #1
    Code:
    Dim intFile As Integer
    intFile = FreeFile
    Open "C:\Afile.bin" For Input As intFile
    Text1.Text = Input(LOF(intFile), intFile)
    Close intFile
    The above puts the entire contents of "C:\AFile.bin" into Text1.Text

    Problem #2
    Code:
    Dim intI As Integer
    For intI = Pic1.LBound To Pic1.UBound
        If ElementExists(Pic1(intI)) Then
            Debug.Print "Pic1(" & intI & ") Contains ";
            Select Case Pic1(intI).Picture.Type
                Case vbPicTypeNone
                   Debug.Print "Nothing"
                Case vbPicTypeBitmap
                    Debug.Print " a Bitmap"
                Case vbpictypeEMetafile
                    Debug.Print " an Enhanced Metafile"
                Case vbPicTypeIcon
                    Debug.Print " an Icon"
                Case vbPicTypeMetafile
                    Debug.Print " a Metafile"
            End Select
        Else
            Debug.Print "Pic1(" & intI & ") Does Not Exist"
        End If
    Next intI
    End Sub
    
    Private Function ElementExists(pic As PictureBox) As Boolean
    Dim intI As Integer
    On Error Resume Next
    intI = pic.Picture.Type
    If Err Then
        ElementExists = False
    Else
        ElementExists = True
    End If
    On Error GoTo 0
    End Function
    If you are sure that your Control Array elements are contiguous then you don't need to use the 'ElementExists' Function.
    Last edited by Doogle; Sep 3rd, 2010 at 01:05 AM.

  28. #28

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    !! Thanks, Doogle. I will try what you have posted !!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  29. #29

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Problem: Can you please send a working demo of your source code, Doogle??? I don't understand very much on this topic...

    Also: I am not sure about your solution about Problem #1, cause I am trying to get the data from a PictureBox and place it into a TextBox control. Then add it to a Binary data file, that is a tempoary file, when the program is running. Then at the time of the save/save as then the file is added to the file that the user chooses. Also then, the temporary file is then deleted as such...

    -- Great help, in deed!!
    Last edited by ThEiMp; Sep 4th, 2010 at 08:17 PM.
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  30. #30
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: In need of some help: PictureBox Loop Saving...

    Why do you want to put the data from the PictureBox into a TextBox control ? It will just be a stream of unprintable characters

  31. #31

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Well I am trying to get the contents of the Bitmap file, and then save them into a Binary file, which has the extension of *.DIR...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  32. #32
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: In need of some help: PictureBox Loop Saving...

    Let me just see if I understand.....

    You've got a lot of PictureBoxes in a Control Array, some of these may have pictures loaded and you want to save those pictures to a file or to a Directory ? Presumably the purpose of saving is to be able to load them at some future time. If that is the case why not just 'remember' which picture got loaded into which picturebox? All you need save is the Index of the control array and the filename and path to the Picture when you load the picture into the picturebox.

  33. #33
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: In need of some help: PictureBox Loop Saving...

    Quote Originally Posted by Doogle View Post
    Let me just see if I understand.....

    You've got a lot of PictureBoxes in a Control Array, some of these may have pictures loaded and you want to save those pictures to a file or to a Directory ? Presumably the purpose of saving is to be able to load them at some future time. If that is the case why not just 'remember' which picture got loaded into which picturebox? All you need save is the Index of the control array and the filename and path to the Picture when you load the picture into the picturebox.
    May be he's trying to accomplish what VB does in a FRX file !

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  34. #34

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Well I would like to do that.

    But: I don't think that the end-user is going to like to keep on adding images, and media files into the project file. Everytime he or she, loads their project file???

    So then: I must Put the .Index of the PictureBox. And then save the bitmap file contents of it, into the project file.

    eg:
    Channel = 2
    Index = 23
    Filename = Hello.bmp
    Height = 200
    Width = 320
    File Contents = Blah Blah
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  35. #35

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Quote Originally Posted by akhileshbc View Post
    May be he's trying to accomplish what VB does in a FRX file !
    Got it in one!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  36. #36
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: In need of some help: PictureBox Loop Saving...

    Well, for the quantity of PictureBoxes you have, depending upon the size of the Pictures themselves, I expect you'll need to use GDI+. However I came upon some code that Merri posted here in 2009 which used a PropertyBag. The code below is based upon Merri's work
    Code:
    Option Explicit
    
    Private Sub Loadpic(pic As PictureBox, intfile As Integer)
    Dim propBag As PropertyBag
    Dim bArray() As Byte
    Dim lngLen As Long
    Set propBag = New PropertyBag
    Get intfile, , lngLen
    If lngLen > 0 Then
        ReDim bArray(lngLen - 1)
        Get intfile, , bArray
        propBag.Contents = bArray
        Set pic.Picture = propBag.ReadProperty(pic.Index, Nothing)
    End If
    Set propBag = Nothing
    End Sub
    
    Private Sub SavePic(pic As PictureBox, intfile As Integer)
    Dim propBag As PropertyBag
    Dim bArray() As Byte
    Set propBag = New PropertyBag
    propBag.WriteProperty pic.Index, pic.Picture
    bArray = propBag.Contents
    Put intfile, LOF(intfile) + 1, UBound(bArray) + 1
    Put intfile, , bArray
    Set propBag = Nothing
    End Sub
    
    Private Sub cmdLoad_Click()
    Dim intfile As Integer
    Dim intI As Integer
    intfile = FreeFile
    Open "C:\SavedPics.bin" For Binary As intfile
    For intI = Pic1.LBound To Pic1.UBound
        Call Loadpic(Pic1(intI), intfile)
    Next intI
    Close intfile
    End Sub
    
    Private Sub cmdSave_Click()
    Dim intI As Integer
    Dim intfile As Integer
    If FileLen("c:\savedpics.bin") <> 0 Then Kill "C:\savedpics.bin"
    intfile = FreeFile
    Open "C:\SavedPics.bin" For Binary As intfile
    For intI = Pic1.LBound To Pic1.UBound
        Call SavePic(Pic1(intI), intfile)
    Next intI
    Close intfile
    End Sub
    The file is likely to get big since the Pictures are not compressed.
    Last edited by Doogle; Sep 5th, 2010 at 03:51 AM.

  37. #37

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    !! Wait a minute !!

    -- With the Score Dialog Box: You point Cast Members to them, instead of having them really inside of the PictureBoxes when it saves and opens the file. So then this what you posted, in the above post. Can be used for the Cast Member Libaray Form, instead of the Score Dialog Box Form.

    Thanks for clearing it up for me!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  38. #38

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: In need of some help: PictureBox Loop Saving...

    Thanks for the help, Doogle. It works. I have added in a 19-Bit File Compressor, as well into the source code, that appears at the time of Save As and Open Dialog Boxes!!

    And now I am going to mark this thread, resolved and I have also Rated Doogle's Post, in this thread!!
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  39. #39

    Thread Starter
    PowerPoster ThEiMp's Avatar
    Join Date
    Dec 2007
    Location
    Take The PCI Bus Across To The CPU!!
    Posts
    3,948

    Re: [RESOLVED] In need of some help: PictureBox Loop Saving...

    I got the saving of the file right. It also gets the code in the right place, as well!!

    Problem: How to load the file right, and also get the right amount of Bitmap data into the right PictureBox??? That is the question...
    I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...

    |Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |

    Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...

  40. #40
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: [RESOLVED] In need of some help: PictureBox Loop Saving...

    Post #36: cmdLoad_Click() which calls Subroutine LoadPic

Page 1 of 2 12 LastLast

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