|
-
May 15th, 2011, 11:00 PM
#12
Thread Starter
Addicted Member
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|