|
-
Aug 22nd, 2012, 10:26 AM
#10
Re: [VB6] - animated gif function errors:(
 Originally Posted by joaquim
why the Delay isn't so easy to catch like image size?
(anotherthing: if i put the "kill "filename"" in loop, don't works, but outside of loop works... only i for catch some interesting errors lol)
It's the same for any field the is 2 or more bytes like the below
LSDLogicalScreenDescription.GifWidth = Asc(Left$(strLogicalScreenDescription, 2))
LSDLogicalScreenDescription.GifHeight = Asc(Mid$(strLogicalScreenDescription, 2, 2))
LSDLogicalScreenDescription.ColorResolution = Asc(BinaryToDecimal(Mid$(PackedField, 2, 3)))
LSDLogicalScreenDescription.GlobalColorSize = Asc(BinaryToDecimal(Mid$(PackedField, 6, 3)))
IDImageDescription.FrameLeft = Asc(Mid$(strFrame, 10, 2))
IDImageDescription.FrameTop = Asc(Mid$(strFrame, 12, 2))
IDImageDescription.FrameWidth = Asc(Mid$(strFrame, 14, 2))
IDImageDescription.FrameHeight = Asc(Mid$(strFrame, 16, 2))
The above should be done the same as for Delay. I told you that you cannot convert 2-bytes to ascii and each one of the above are 2 bytes or more. The only reason you have gotton the correct results, if you have, is that you have been lucky but they are not correct,
I don't know how BinaryToDecimal works so I cannot comment on it as to whether it's correct or not.
Also, you are passing a 3-byte field and as I have told you several times they are not bytes; they are bits.
LSDLogicalScreenDescription.ColorResolution = Asc(BinaryToDecimal(Mid$(PackedField, 2, 3)))
LSDLogicalScreenDescription.GlobalColorSize = Asc(BinaryToDecimal(Mid$(PackedField, 6, 3)))
This is what the Packed Field looks like:
Code:
Global Color Table Size ----------------------+
Sort Flag --------------------------------+ |
Color Resolution ---------------------+ | |
Global Color Table Flag ----------+ | | |
| | | |
| | | |
7 6 5 4 3 2 1 0
+-+-----+-+-----+
| | | | |
+-+-----+-+-----+
Last edited by jmsrickland; Aug 22nd, 2012 at 12:32 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.
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
|