Results 1 to 17 of 17

Thread: Movement between GIF images

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Movement between GIF images

    First a question. In the program included should I be expecting to not have Picture1 change immediately(on the screen running through VB versus compiled) after I press the mouse button. I think I've been through this discussion before. Does Picture1.PaintPicture take a while to process while the program will continue on with the rest of the code??? I keep noticing the long delay before the image changes and it just hit me that this might be the reason why.

    After hitting the left mouse button the program brings up the 6 hour forecast image and it should start calculating the precip that is suppose to fall over each pixel of the map(works great) and then create a 6 hour forecast map that has had the isobar(black) and 540(red and blue) lines removed/smoothed out of the image(works great). Basically this is just a copy/smooth of the original 6 hour forecast map leading the way into the 12 hour forecast map. When it brings up the 12 hour forecast map it should now take the precip that was forecasted to fall in the first 6 hours and add it to the precip forecasted to fall in the next 6 hours to give the 12 hour accumulated precip(works great...kind of I think).

    It appears to be doing it correctly except now when it redraws the new map the whole map image has shifted both down and to the right from where it was on the original 6 hour forecast or where it is on the original images to start with. It kinda looks like it has tried to increase the size of the image as the top and left hand side of the image is still in the same location. I see the right side of the image that normally is blank now is mostly map when it goes to image 2. After the initial move it doesn't move again it stay down and to the right of where it should be for image 3. I haven't carried it any further yet than image 3. I can't see any reason for this unwelcomed move in the code. I see the precip bar(far left side of the screen) even has some shifting, both downwards and very slightly to the right.

    Why is this occuring. What have I did wrong that is making this happen. I've looked the code over numerous times trying to make sense of what I've did wrong and I don't see it.

    Also, by any chance...is their a quicker way of accomplishing this? You have to be able compute from one map to the next what the total is and carry it forward, hence why I've went with the 2-D array to store the precip total for each pixel and hence why I've also just been doing it with Picture1.Point versus using BitBit. From what I've seen it sounds like BitBit wouldn't work under these circumstances for this kind of purpose...or am I wrong?
    Attached Files Attached Files

  2. #2
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    Private HijackBinding As IBinding ' set-up so I can access as I wish
    Private Sub IBindStatusCallback_OnStartBinding(ByVal dwReserved As Long, ByVal pib As olelib.IBinding)

    Not defined or declared. Can't run your project

    I get error

    Compile-error: User-defined type not defined
    Last edited by jmsrickland; May 15th, 2011 at 12:54 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  3. #3
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    ....hence why I've went with the 2-D array to store the precip total for each pixel and hence why I've also just been doing it with Picture1.Point versus using BitBit. From what I've seen it sounds like BitBit wouldn't work under these circumstances for this kind of purpose...or am I wrong?

    From what I saw where you were using the Point and PSet methods BitBlt should do the same thing much much much faster. Why do you think BitBlt wont work in this circumstance?


    EDIT:

    Well, after thinking about it and looking further into your code I see now why you are using the Point and PSet methods. If you are getting the X and Y of the pixel to obtain it's color (and retain the X and Y where you got it) then you do need that 2-D array but only if you are using that 2-D array elsewhere which I didn't see it in your code at first but I see it now.
    Last edited by jmsrickland; May 15th, 2011 at 03:41 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

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

    Re: Movement between GIF images

    I managed to compile it but then fell foul of not having any data files.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    Doogle,

    My message to JM just got erased. DRATS! Boy do I wish I wouldn't have gotten blocked by the ISP. I keep losing more messages as a result of having to go through a proxy server than I could ever imagine. I'll retype it in a minute. This one will be quicker to get out.

    When you run the program it's setup to automatically update the files as far back as it can the files on the server, typically 4-5 days is all the longer back the gov't keeps the old forecast maps on their server. When you run the program it should automatically download them. I do have it set to store at a fixed location(D:\C Drive\Convert\GFSMaps) versus otherwise. I'm bad about doing that since I'm always writing for me and not anyone else I never end up setting anything up using Common Dialog like I should. Once it's done downloading it should show the current forecast map on the screen. I have it set up right now so when you click on the screen with the mouse it should start going through and adding up the precip on each of the maps. I have it so it will only go through and make the first 3 maps currently since it takes 2 minutes or so per map(at least with my PIII 595Mhz PC it takes that long).

    If Counter2 < 7 Then
    Counter2 = Counter2 + 2
    GoTo GenerateMaps
    Else

    To create the whole series of maps you would have to change the 7 to a 65 and then it would go through and create the whole series for the most recent forecast model the gov't has issued.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    JM,

    I'll try this message again. Daggone, proxy server didn't keep me logged into the forum so I ended up losing the message before.

    I have a bad habit of reusing programs when I start a new name. Literally just go out and change the name of the form, and the name I'm saving the form and project as. Otherwise I delete nothing. I end up keeping stuff around in case I need later on as I generally figure I will. That's what happened this time. Sorry about that. The HiJacksDL hasn't been used by anything yet. I forgot to remove it and all references to it before I posted the message.

    What I did before was just for testing to feel the waters and see how things would go/expand my knowledge and understand of what is possible and how to do it.

    What I'm thinking??? the final objective is, and how I currently have the everything set up is to:

    1. Scan the screen and take each pixel and set a value to it according the chart on the left hand side of the screen to indicate how much rain is suppose to fall according to the chart. I believe they always list the precip in 6 hour increments, so what you see is the rain fall for the previous 6 hours. I want to smooth out the black/red/blue lines, where necessary(DelIso540).
    2. Store the rain fall value.
    3. Create the 6 hour forecast model. This one will look a lot like the original image except it should be missing the black/red/blue lines.
    4. Bring up the next(12 hour forecast) map.
    5. Scan the image and add the value to the value from the 6 hour model.
    6. Store the value.
    7. Create the 12 hour forecast model from the values stored in #6.
    8. Go back to #4 for the 18 forecast map, etc on up to the end of the forecast model(384 hours).

    Once the precip amount is determined for the particular pixel it goes back and changes that precip back into color based on a range of value (.5-.75 inches of rain, for example). The one thing I have had going through mind that I would like to do, not exactly sure how with the number of maps to be created, is to have it so I could also have the value stored so when I run the mouse across the screen it will show at the bottom of the screen how much rain fall, down to the specific amount, not the color coded range amount, that each spot is suppose to get. I know the final value I could easily to do this with but intermediate values, 12 hour, 72 hour, 300 hour, etc would be much more difficult unless I went to a 3-D array.

    I was going to bring up the BitBlt but the more I think about what I'm really trying to do and may want to try to do I'm thinking BitBlt may be quite hard to work with unless you somehow set up two memory areas that could be referenced from/to...one for incoming(reading pixel value) and one for outgoing(writing pixel value). At that, if I were to try to proceed with the 3-D notion than it would make it pretty much impossible I think.

    To see if I have the general understanding of BitBlt call routine. After having the function declared to send to a memory location you would use:

    Call BitBlt(hDC, 0, 0, 1024, 768, Picture1.hDC, 0, 0, vbSrcCopy)

    Do I have at least that much understood or am I totally lost so far

  7. #7
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    I was going to bring up the BitBlt but the more I think about what I'm really trying to do and may want to try to do I'm thinking BitBlt may be quite hard to work with unless you somehow set up two memory areas that could be referenced from/to...

    I have an idea.....

    Instead of doing this:

    Code:
        '
        '
        '
        For Xpos = 0 To 80 'copy rain gauge bar
            For Ypos = 335 To 768
                Picture6.PSet (Xpos, Ypos), Picture1.Point(Xpos, Ypos)
            Next Ypos
        Next Xpos
        .
        .
        .
    try this:

    Code:
        '
        Dim rCode as Long
        '
        '
        '
        ' Pick up only the color values. Do not do Picture6.PSet (Xpos, Ypos)
        '
        For Xpos = 0 To 80 'copy rain gauge bar
            For Ypos = 335 To 768
                Picture1.Point(Xpos, Ypos)
            Next Ypos
        Next Xpos
    
        '
        ' Now, instead of PSet, BitBlt the image
        '
        rCode = BitBlt(Picture6.hDC, 0, 0, 1024, 768, Picture1.hDC, 0, 0, vbSrcCopy)
       .
        .
    I think you will get identical results but much faster and speed is what you need. When I ran your code the other day I had time to go to the store and back before your Point/PSet method finished.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    Tried the idea and...well...it failed miserably. All it did was a pure copy of the image in Picture1. Still had the black/red/blue lines in the picture that should have been removed.

    Picture1.Point(XPos,YPos)

    Doesn't work because it needs something before it or after it. I did:

    rCode = Picture1.Point(XPos,YPos)

    After seeing that all it did was just do a perfect copy from one picturebox to the next I decided to try something a little different...figuring it wouldn't work and it didn't. Since I'm trying to pull the color code and add it up/change in the long run I:

    For Xpos = 0 To 80 'copy rain gauge bar
    For Ypos = 335 To 768
    mapImage(Xpos, Ypos) = Picture1.Point(Xpos, Ypos)
    Next Ypos
    Next Xpos

    and then down where I convert the precip amount back into color code I:

    If mapImage(Xpos, Ypos) = 2508683 Then mapImage(Xpos, Ypos) = 2508683
    If mapImage(Xpos, Ypos) = 0 Then mapImage(Xpos, Ypos) = 16777215
    If mapImage(Xpos, Ypos) = 0.01 Then mapImage(Xpos, Ypos) = 65407
    etc., etc., etc.

    Followed by:

    rCode = BitBlt(Picture6.hDC, 0, 0, 1024, 768, mapImage(Xpos, Ypos).hDC, 0, 0, vbSrcCopy)

    I kinda figured the mapImage idea wouldn't work and it didn't, was worth a try at least.

    From what I've seen, once you have transferred the image to memory how do read/change the memory? What's the method for accessing it?

  9. #9
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    Sorry, I meant to do this:


    Code:
        '
        Dim rCode as Long
        '
        '
        '
        ' Pick up only the color values. Do not do Picture6.PSet (Xpos, Ypos)
        '
        For Xpos = 0 To 80 'copy rain gauge bar
            For Ypos = 335 To 768
                mapImage(XPos, YPos) = Picture1.Point(XPos, YPos)        
            Next YPos
        Next XPos
    
        '
        ' Now, instead of PSet, BitBlt the image
        '
        rCode = BitBlt(Picture6.hDC, 0, 0, 1024, 768, Picture1.hDC, 0, 0, vbSrcCopy)
        .
    This has to work because all I'm doing is subsituting BitBlt instead of PSet. The picture should be the same as though you had done it using PSet in the For loop
    Last edited by jmsrickland; May 15th, 2011 at 08:24 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    The only thing is it doesn't take into any account any changes that get made to mapImage. Using the code belo all I get is a pure copy from Picture1 to Picture6.

    Code:
        For Xpos = 0 To 80 'copy rain gauge bar
            For Ypos = 335 To 768
                mapImage(Xpos, Ypos) = Picture1.Point(Xpos, Ypos)
            Next Ypos
        Next Xpos
        
        For Xpos = 81 To 950 '1024
            For Ypos = 29 To 749
                Rain = Picture1.Point(Xpos, Ypos)
                If Rain = 255 Or Rain = 16711680 Or Rain = 0 Then Call DelIso540(Rain, Xpos, Ypos)
                If Rain = 16777215 Then Rain = 0
                If Rain = 65407 Then Rain = 0.01
                If Rain = 52480 Then Rain = 0.1
                If Rain = 35584 Then Rain = 0.25
                If Rain = 9129488 Then Rain = 0.5
                If Rain = 16748574 Then Rain = 0.75
                If Rain = 15643136 Then Rain = 1
                If Rain = 15658496 Then Rain = 1.25
                If Rain = 13461641 Then Rain = 1.5
                If Rain = 15608977 Then Rain = 1.75
                If Rain = 9109643 Then Rain = 2
                If Rain = 139 Then Rain = 2.5
                If Rain = 205 Then Rain = 3
                If Rain = 16622 Then Rain = 4
                If Rain = 32767 Then Rain = 5
                If Rain = 34253 Then Rain = 6
                If Rain = 55295 Then Rain = 7
                If Rain = 61166 Then Rain = 8
                If Rain = 65535 Then Rain = 9
                If Rain = 2508683 Then
                    mapImage(Xpos, Ypos) = 2508683
                Else
                    mapImage(Xpos, Ypos) = mapImage(Xpos, Ypos) + Rain
                End If
            Next Ypos
        Next Xpos
                        
        For Xpos = 81 To 950 '1024
            For Ypos = 29 To 749
                If mapImage(Xpos, Ypos) = 2508683 Then mapImage(Xpos, Ypos) = 2508683
                If mapImage(Xpos, Ypos) = 0 Then mapImage(Xpos, Ypos) = 16777215
                If mapImage(Xpos, Ypos) = 0.01 Then mapImage(Xpos, Ypos) = 65407
                If mapImage(Xpos, Ypos) > 0.01 And mapImage(Xpos, Ypos) <= 0.1 Then mapImage(Xpos, Ypos) = 52480
                If mapImage(Xpos, Ypos) > 0.1 And mapImage(Xpos, Ypos) <= 0.25 Then mapImage(Xpos, Ypos) = 35584
                If mapImage(Xpos, Ypos) > 0.25 And mapImage(Xpos, Ypos) <= 0.5 Then mapImage(Xpos, Ypos) = 9129488
                If mapImage(Xpos, Ypos) > 0.5 And mapImage(Xpos, Ypos) <= 0.75 Then mapImage(Xpos, Ypos) = 16748574
                If mapImage(Xpos, Ypos) > 0.75 And mapImage(Xpos, Ypos) <= 1 Then mapImage(Xpos, Ypos) = 15643136
                If mapImage(Xpos, Ypos) > 1 And mapImage(Xpos, Ypos) <= 1.25 Then mapImage(Xpos, Ypos) = 15658496
                If mapImage(Xpos, Ypos) > 1.25 And mapImage(Xpos, Ypos) <= 1.5 Then mapImage(Xpos, Ypos) = 13461641
                If mapImage(Xpos, Ypos) > 1.5 And mapImage(Xpos, Ypos) <= 1.75 Then mapImage(Xpos, Ypos) = 15608977
                If mapImage(Xpos, Ypos) > 1.75 And mapImage(Xpos, Ypos) <= 2 Then mapImage(Xpos, Ypos) = 9109643
                If mapImage(Xpos, Ypos) > 2 And mapImage(Xpos, Ypos) <= 2.5 Then mapImage(Xpos, Ypos) = 139
                If mapImage(Xpos, Ypos) > 2.5 And mapImage(Xpos, Ypos) <= 3 Then mapImage(Xpos, Ypos) = 205
                If mapImage(Xpos, Ypos) > 3 And mapImage(Xpos, Ypos) <= 4 Then mapImage(Xpos, Ypos) = 16622
                If mapImage(Xpos, Ypos) > 4 And mapImage(Xpos, Ypos) <= 5 Then mapImage(Xpos, Ypos) = 32767
                If mapImage(Xpos, Ypos) > 5 And mapImage(Xpos, Ypos) <= 6 Then mapImage(Xpos, Ypos) = 34253
                If mapImage(Xpos, Ypos) > 6 And mapImage(Xpos, Ypos) <= 7 Then mapImage(Xpos, Ypos) = 55925
                If mapImage(Xpos, Ypos) > 7 And mapImage(Xpos, Ypos) <= 8 Then mapImage(Xpos, Ypos) = 61166
                If mapImage(Xpos, Ypos) > 8 And mapImage(Xpos, Ypos) <= 9 Then mapImage(Xpos, Ypos) = 65535
            Next Ypos
        Next Xpos
        rCode = BitBlt(Picture6.hDC, 0, 0, 1024, 768, Picture1.hDC, 0, 0, vbSrcCopy)

  11. #11
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    You have to use BitBlt after this loop

    Code:
        For Xpos = 0 To 80 'copy rain gauge bar
            For Ypos = 335 To 768
                mapImage(Xpos, Ypos) = Picture1.Point(Xpos, Ypos)
            Next Ypos
        Next Xpos
     
       BitBlt(....) '<------------HERE

    I tried my bitblt example on your earlier version and it copied the image just as if it had been done using PSet. No difference at all. It doesn't matter if you use PSet or BitBlt the end results are the same and BitBlt is so much faster. I don't see why you think it is not working and I don't see what it has to do with mapImage (I'm not really looking at the rest of your code) unles you are modifying mapImage later on then you cannot use BitBlt later on for that reason but for the first time at Picture6_MouseUp in that For.....Next loop you had I get the same results
    Last edited by jmsrickland; May 15th, 2011 at 09:10 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  12. #12

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    Okay I understand what your saying now. I tried it and dang does it ever work faster. Actually I took it a step further and got rid of part of the problem I was having earlier as well. I went ahead and put the BitBlt(slightly modified 0,0,80,768...just so it would copy the rain gauge diagram) right after the For-Next loop and when I did a quick multiple run through it did copy the rain gauge over correctly in each image unlike before.

    I still can't get the rest of the map to fit in the picturebox like it should for some reason. That one has me stumped.

    I know I have read about being able to take BitBlt and send it to memory...and back.

    Dim hDC As Long

    hDC = CreateCompatibleDC(0&)
    Call BitBlt(Picture2.hDC, 0, 0, 100, 100, hDC, 0, 0, vbSrcCopy)

    I would think you would be able to modify the memory once you have something in the memory, couldn't you. Then writing it back from memory to the picturebox would be easy and maybe correct as well. How do write/change the memory once you have placed something into memory from a picturebox? Or am I misunderstand what I've read. I'm looking at:

    http://edais.mvps.org/Tutorials/GDI/DC/DCch1.html

    From the above site:
    Private Sub Picture2_Paint()
    Dim hDC As Long, hOldBmp As Long

    hDC = CreateCompatibleDC(0&)
    hOldBmp = SelectObject(hDC, Picture1.Picture.Handle)

    'right here is where it seems like any picture modification code would have to go but how would you go about modifying the picture?
    Call BitBlt(Picture2.hDC, 0, 0, 100, 100, hDC, 0, 0, vbSrcCopy)
    Call SelectObject(hDC, hOldBmp)
    Call DeleteDC(hDC)
    End Sub

    Like I said the idea of using BitBlt where nothing changes did partially take care of the problem I've been having. I'm still trying to figure out why I'm having the problem though in the first place. It doesn't seem like there should be any adjustment in the placement of the image. Nothing in the code indicates any movement...their is very noticable movement though.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    You are right it does speed it up quite nicely. I ended up modifying the code to only copy the rain gauge and also found that it copied the rain gauge over correctly for multiple images as well, unlike the PSet method where I've been having all the trouble.

    On this page:
    http://edais.mvps.org/Tutorials/GDI/DC/DCch1.html

    It makes it sound like you can save the picturebox to memory and then call it back from memory. Using this code:

    Code:
    Private Sub Picture2_Paint()
        Dim hDC As Long, hOldBmp As Long
        
        hDC = CreateCompatibleDC(0&)
        hOldBmp = SelectObject(hDC, Picture1.Picture.Handle)
        
        'put the memory modifying code in here.  How do you modify the memory though.
    
        Call BitBlt(Picture2.hDC, 0, 0, 100, 100, hDC, 0, 0, vbSrcCopy)
        Call SelectObject(hDC, hOldBmp)
        Call DeleteDC(hDC)
    End Sub
    I would think you should be able to write/change/read memory. If I could get this to work it might lead to the end of the problem I was having initially when I made this post earlier. I still can't figure out why the image on the second and subsequent forecast maps always seems to move down and to the right on me.

  14. #14
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    Why do you need so may maps? I counted 2,916 on the last time I ran your project. It takes forever to download these maps. You need a better way to download. Are other people going to use this application?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  15. #15

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    The reason the project got started was I heard someone talking about following a forecast hour forward. For example, looking at the map for this coming Saturday at 1200 UTC. When the next model comes out you look at the same map time to see how the forecast has changed. Different forecast modeling techniques have their own nuances(sp?) and to know when to expect the model you are using to be wrong you have to learn how the certain model you are using is weak/what it doesn't look at/incorporated into the way the model builds its forecasts. One of the ways of seeing where a model is weak to start watching out in the future 8-10 days even 16 days out and see where it screws up the forecast and see if there is a pattern to when its going to goof up. Normally I hear of the guys using 7-8 days and following a storm front as it moves across the country and the days get dropped. They still keep the focus on the same time and see if the storm front speeds up or slows down or even moves differently than what had been expected earlier on in the previous forecasts. They also use the closer in maps for forecasting the next couple of days and they also look further out into the future for any possible big storms that might be coming.

    I thought there was only 4-5 days kept on the NOAA/NCEP server, at 81 maps per model forecast period and 4 model forecast periods per day.

    So far, out of the numerous different programs I've written, I've been the only person using any of them. That is pretty much the concept for this as well, but you never know what might happen. Two months ago I wouldn't even had thought about doing anything like this.

    I realize most of the program is in shambles right now, LOL In my opinion, its in shambles. I think the only thing I have right now that is pretty much working the way I want to work(MAY do a real slight tweak) is the concept of following a forecast time forward/backward. Everything else is only partially working but I keep getting closer with it day by day as the I get the the chance to be to work on it. Somethings I'm pretty much limited to by needing a decent working internet connection which it seems like I only get once a week anymore. Today the focus shifted due to having the good internet connection where I can test and change things to make sure everything is going to run the way I want it to. I got the new code added in and now I just need to get the darn code to download, PERIOD. For some reason the old code and the new code won't download like it should. The old code that I copied over was working correctly and I was trying to put everything under one section of code like it should be. Copying it over has caused something to happen...more debugging at hand.

    I have it setup for the downloading right now as the way of testing the full downloading concept for both current map models and also downloading past models. There are several things in there I knew I needed to get working and I just put everything together versus separating them like they should be. I can easily see having it so it checks for/downloads the current model when the program is run and then you have to go up to the menu to download back models. I haven't separated it out like that yet. I do plan to.

    With a decent connection it shouldn't take long to download the 81 maps, roughly 5Mb, of the current model. Like I said above from what I had seen it seemed like their was normally only 4-5 days kept on the server of the old forecast models. I guess you found a few more.

  16. #16
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Movement between GIF images

    It's difficult for me to test your code as I am not sure what I am supposed to be looking for. It blows my mind to try to understand all those numeric values and what you are doing with them based on certain circumstances. Also, I need a way to get out of the loading loop after it's downloaded 1 map as I would only test with one map anyway.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  17. #17

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Posts
    185

    Re: Movement between GIF images

    Sorry JM about the delay in getting back to you. Between a couple of things and almost stumbling into the answer to the main problem that got this posting started, I haven't had the chance to get back to you yet.

    Based off your last posting I decided to completely strip the program down to the problem only...take everything else out of the program. As a result when I went to make sure the problem was still there...it wasn't. I decided to be a smart boy and start adding back into the program until it broke. The first thing I had to do was add back in all the Function declaration and the ability to save the gif image once it was processed. Upon adding it back in and running the program, the problem was back. I took all the miscellaneous Function declaration back out and the problem was still there. I commented out the 5-6 lines on saving the gif file and the problem disappeared once again. Now I knew I had narrowed the problem down to what was causing the problem in the first place. I just finished saving as a regular bitmap and it still works fine. The problem only comes into play when I try to save as a gif. Something in the cDIB gif routines is causing the effect.

    I've included the stripped down version. It will only download 3 gif files and work with the 3 gif files versus anymore than that. Now the 3 images each have the precip shown on the map. I forgot to ever make mention that the precip is a total of the expected precip over the PAST 6 hours, the first two maps 00 and 03 hour forecast don't have any precip showing on them and they don't have the precip bar on the left hand side either. My dumb forgetfullness. Now all three images have both the precip bar and precip on the images so this should make it much easier to understand what your looking at.

    Everything with this works fine, just slowly, other than the fact the first image comes across fine, and the next two are always ?????scaled incorrectly, or whatever actually is happening. I'm beginning to think its a scaling issue. I tried to change some of the .height/.width in the cDIBSectionSave class module over to .scaleheight/.scalewidth but all I ended up getting were errors, from 'Method or data member not found' to 'Type Mismatch'(down in the error handling routine). You have to run through the save routine the first time before the problem starts to exist.

    I would much rather save as .gif than as bitmap for file size. I'm trying to leave all door open as I have come to realize looking back at the last year or two that one program always leads to next and I'm better off solving this issue now so I know the answer for later. I don't know what could be next, but I don't think I want to be stupid enough to not prepare myself for it. HA

    PS. I left program setup right now to run saving as bitmap. I also commented the code IN ALL CAPS as to what has to change to make the change over to saving as gif.
    Attached Files Attached Files

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