Dynamic Images

What I am really trying to do is display a progressbar with a percent on a flexgrid for a download. I plan on doing this by making 100 images, each one with a percent of the download, ex:

Global PicProgress(100) As Image

However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, and as of now it doesn't point to any data for me to edit.

Normally, you go Image = loadimage(bitmap) and you got your image. How do I do this similar process without loading a bitmap?

Comments

  • : What I am really trying to do is display a progressbar with a percent on a [red]flexgrid???[/red] for a download. I plan on doing this by making 100 images, each one with a percent of the download, ex:
    :
    : Global PicProgress(100) As Image
    :
    : However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, and as of now it doesn't point to any data for me to edit.
    :
    : Normally, you go Image = loadimage(bitmap) and you got your image. How do I do this similar process without loading a bitmap?
    :

    However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, [blue]and as of now it doesn't point to any data for me to edit??? -- display???[/blue].


    Why don't use the Microsoft Progress Bar? Ok, it is only a line of 'little boxes'. VB3 cames with the Gauge, you put a background image and it displays a 'line' or a 'bar' indicating the current position or scale. Like you seen it has something in common it's only a 'draw' of a line, a box, or a 'bar'. Try to use the 'line' method. You can draw and fill boxes using the Line method.

    Ok, what's so diferent in the 100 hundred images that you want to use? But if still you want to use a graphical interface, why don't use a background and draw on it. Something like this... Still there is a gauge directory in the bitmaps directory in your Visual Studio.

    You need a Image Control and a timer...
    [code]
    Option Explicit

    Dim x As Integer ' MAX_INT_VB 32767 (2 bytes)
    Dim perc As Integer

    Private Sub Form_Load()
    perc = Image1.Width / 100 ' PERCENTAJE OF THE PICTURE TO SHOW IN EACH LOOP
    Image1.Picture = LoadPicture("C:Internationalization_my_a##mypicture.jpg") ' ONLY LOAD A IMAGE ONCE WITH THE 100 IMAGES JOINED
    Timer1.Enabled = True
    Timer1.Interval = 100 ' MY MILISECONDS
    End Sub

    Private Sub Form_Unload(Cancel As Integer)
    Debug.Print x
    End Sub

    Private Sub Timer1_Timer()
    Image1.Width = (perc * x) ' MATH MULTIPLY 1 PERCENT OF THE IMAGE BY THE PERCENT COMPLETED
    x = x + 1 ' OF COURSE ADD ONE

    If x = 100 Then Timer1.Enabled = False: Debug.Print "im sure this stops"
    End Sub
    [/code]

    And this without picture, need a picturebox control and a timer...
    [code]
    Option Explicit
    Dim x As Integer

    Private Sub Form_Load()
    Timer1.Enabled = True
    Timer1.Interval = 100
    End Sub

    Private Sub Timer1_Timer()
    Picture1.Line (1, 1)-Step(x, 100), , B ' REMEMBER THIS IS IN TWIPS, THE LETTER B IS FOR BOXES
    x = x + 10
    If x = 1000 Then Timer1.Enabled = False ' THIS WILL COUNT TO 100 CAUSE THE ADDITION OF 10, NOT 1000
    End Sub
    [/code]

    There is still a lot of ways to do it, search for 'Animation Control', 'Picture Clip Control'. The PictureClip control provides an efficient mechanism for storing multiple picture resources. Instead of using multiple bitmaps or icons, create a source bitmap that contains all the icon images required by your application. When you need to display an individual icon, use the PictureClip control to select the region in the source bitmap that contains that icon.
  • : What I am really trying to do is display a progressbar with a percent on a flexgrid for a download. I plan on doing this by making 100 images, each one with a percent of the download, ex:
    :
    : Global PicProgress(100) As Image
    :
    : However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, and as of now it doesn't point to any data for me to edit.
    :
    : Normally, you go Image = loadimage(bitmap) and you got your image. How do I do this similar process without loading a bitmap?
    :

    Can't you use the standard control called progressbar? It's somewhere in one of the common controls!

    Greets...
    Richard

  • : : What I am really trying to do is display a progressbar with a percent on a flexgrid for a download. I plan on doing this by making 100 images, each one with a percent of the download, ex:
    : :
    : : Global PicProgress(100) As Image
    : :
    : : However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, and as of now it doesn't point to any data for me to edit.
    : :
    : : Normally, you go Image = loadimage(bitmap) and you got your image. How do I do this similar process without loading a bitmap?
    : :
    :
    : Can't you use the standard control called progressbar? It's somewhere in one of the common controls!
    :
    : Greets...
    : Richard
    :
    :

    If you can put the progressbar on a flexgrid, then tell me how please.

    BTW the app I am working on can be found a www.memelog.com/bottler, along with the source.
  • [b][red]This message was edited by PURDooM at 2003-8-15 7:2:35[/red][/b][hr]
    : : What I am really trying to do is display a progressbar with a percent on a [red]flexgrid???[/red] for a download. I plan on doing this by making 100 images, each one with a percent of the download, ex:
    : :
    : : Global PicProgress(100) As Image
    : :
    : : However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, and as of now it doesn't point to any data for me to edit.
    : :
    : : Normally, you go Image = loadimage(bitmap) and you got your image. How do I do this similar process without loading a bitmap?
    : :
    :
    : However, when this hapens, it appears that the variable is nearly a handle or a pointer to an image, [blue]and as of now it doesn't point to any data for me to edit??? -- display???[/blue].
    :
    :
    : Why don't use the Microsoft Progress Bar? Ok, it is only a line of 'little boxes'. VB3 cames with the Gauge, you put a background image and it displays a 'line' or a 'bar' indicating the current position or scale. Like you seen it has something in common it's only a 'draw' of a line, a box, or a 'bar'. Try to use the 'line' method. You can draw and fill boxes using the Line method.
    :
    : Ok, what's so diferent in the 100 hundred images that you want to use? But if still you want to use a graphical interface, why don't use a background and draw on it. Something like this... Still there is a gauge directory in the bitmaps directory in your Visual Studio.
    :
    : You need a Image Control and a timer...
    : [code]
    : Option Explicit
    :
    : Dim x As Integer ' MAX_INT_VB 32767 (2 bytes)
    : Dim perc As Integer
    :
    : Private Sub Form_Load()
    : perc = Image1.Width / 100 ' PERCENTAJE OF THE PICTURE TO SHOW IN EACH LOOP
    : Image1.Picture = LoadPicture("C:Internationalization_my_a##mypicture.jpg") ' ONLY LOAD A IMAGE ONCE WITH THE 100 IMAGES JOINED
    : Timer1.Enabled = True
    : Timer1.Interval = 100 ' MY MILISECONDS
    : End Sub
    :
    : Private Sub Form_Unload(Cancel As Integer)
    : Debug.Print x
    : End Sub
    :
    : Private Sub Timer1_Timer()
    : Image1.Width = (perc * x) ' MATH MULTIPLY 1 PERCENT OF THE IMAGE BY THE PERCENT COMPLETED
    : x = x + 1 ' OF COURSE ADD ONE
    :
    : If x = 100 Then Timer1.Enabled = False: Debug.Print "im sure this stops"
    : End Sub
    : [/code]
    :
    : And this without picture, need a picturebox control and a timer...
    : [code]
    : Option Explicit
    : Dim x As Integer
    :
    : Private Sub Form_Load()
    : Timer1.Enabled = True
    : Timer1.Interval = 100
    : End Sub
    :
    : Private Sub Timer1_Timer()
    : Picture1.Line (1, 1)-Step(x, 100), , B ' REMEMBER THIS IS IN TWIPS, THE LETTER B IS FOR BOXES
    : x = x + 10
    : If x = 1000 Then Timer1.Enabled = False ' THIS WILL COUNT TO 100 CAUSE THE ADDITION OF 10, NOT 1000
    : End Sub
    : [/code]
    :
    : There is still a lot of ways to do it, search for 'Animation Control', 'Picture Clip Control'. The PictureClip control provides an efficient mechanism for storing multiple picture resources. Instead of using multiple bitmaps or icons, create a source bitmap that contains all the icon images required by your application. When you need to display an individual icon, use the PictureClip control to select the region in the source bitmap that contains that icon.
    :


    Its all great code, and I am considering using this, but here is what I am really trying to do:

    I have a flexgrid. It has rows on it which may say 'Downloading "filename" 30% complete' in a nice grid format. I am trying to switch the text of the 30% to a graphical indicator, possibly with the text of the 30% on top of it. I have the following problems:

    1) The 'percent completed' row may resize at any time (users using the interface). The image inside also needs to resize to reflect how much progress is being made
    2) There may be more than 1 or even 100 downlaods happening at once. I would like to have 100 images on hand I can simply put in for any percent complete on the grid
    3) I can't seem to draw text/graphics using stuff like .print onto a picturebox and make it actually copy onto the flexgrid when I set .cellpicture = mypicture(percent).picture. Seems the data was never saved.

    For an update, I have decided to make a controll array of 100 invisible pictureboxes on the main form, each containing a blank bitmap right off the bat. I don't have to worry about initalization now. Now if only I could write to these bitmaps text, and copy it with .cellpicture = mypicture(percent).picture im set.

    If it helps, you can use my app or look at the sourcecode at www.memelog.com/bottler

    Thanks for all your help


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories