Saving Forms at runtime

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dr3amxstar
    New Member
    • May 2007
    • 55

    #1

    Saving Forms at runtime

    hihi have been racking my brain over this

    I have a program that draws rectangles , boxes , prints text on listbox and labels on the form based on the similarity of the
    sequences from my results( taken from another program) . All this are added as I go.

    As i have alot of such sequences whereby each sequence wil give me different images ( those drawings , the form is refreshed everytime a new sequence is acesss, i will have to save each drawings at the end of each sequences.

    I thought of saving it to mircosoft word but it seems quite a hassle since the program is printing rectangles at different segment of codes as the program goes along

    Dim objWordApp As New Word.Applicatio n
    .....

    Print screen is out because the sequences can be very long and there will be scrollbars as such.

    So i would like ask whether i can save the built form to anything that can be viewed later automatically?

    This is the example of the output :

  • kadghar
    Recognized Expert Top Contributor
    • Apr 2007
    • 1302

    #2
    hi

    i can come to a simple example where you have 20 rectangles that may be white, red or blue, so make an array

    dim myArray(1 to 20) as integer

    then put 0 if white, 1 if red and 2 if blue for each of the 20 integers.
    then save them into a string

    dim str1 as string
    dim i as integer
    str1=""
    for i = 1 to 20
    str1=str1 & myArrya(i) & " "
    next
    str1 = str1 & chr(10)

    and after that write down the string into a txt file, so you'll have each combination in each line... then make a code for reading them from the txt file..

    That has helped me with similar problems

    Good Luck

    Comment

    • dr3amxstar
      New Member
      • May 2007
      • 55

      #3
      Originally posted by kadghar
      and after that write down the string into a txt file, so you'll have each combination in each line... then make a code for reading them from the txt file..

      That has helped me with similar problems

      Good Luck
      Hmm i dont quite understand.. I do not need to read the rectangle from any files. The pictures shown is the output i get from my program. I will have to save the output in the form so that i will be able to view it when i am not running the program.

      Comment

      • kadghar
        Recognized Expert Top Contributor
        • Apr 2007
        • 1302

        #4
        Originally posted by dr3amxstar
        Hmm i dont quite understand.. I do not need to read the rectangle from any files. The pictures shown is the output i get from my program. I will have to save the output in the form so that i will be able to view it when i am not running the program.
        what i ment was that if you really need the information as an image?

        Maybe there is some text format or table format that could be usefull as well and easier to save into a file.

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          What version of VB are you using? (Sorry if it was obvious from the image - my work server blocks them for some reason).

          In VB6, you should be able to use the SavePicture statement. Note that it may come out blank unless you have AutoRedraw set to True when you do the drawing. I've always found it takes lots of trial and error to get things right when dealing with .Image or .Picture properties.

          Comment

          • dr3amxstar
            New Member
            • May 2007
            • 55

            #6
            oops sorry to mention. i'm using VB 2005 Express Edition.

            Originally posted by kadghar
            what i ment was that if you really need the information as an image?

            Maybe there is some text format or table format that could be usefull as well and easier to save into a file.
            I understood what u meant and it make sense haha.. I think the easier way out is to make it into like some text format.. cos like what killer42 said, " it takes lots of trial and error to get things right when dealing with .Image or .Picture properties." Its true !


            I added in the menuscript but was not very clear on the code for saving. It is able to save the form?

            Comment

            • Killer42
              Recognized Expert Expert
              • Oct 2006
              • 8429

              #7
              I really think you are going to have to save it as a JPG or GIF image (or even, heaven forbid, a BMP image). In VB6, that would be via the SavePicture function. In VB 2005, I have no idea.

              Comment

              Working...