•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 455,987 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,781 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1924 | Replies: 0
![]() |
•
•
Join Date: Aug 2004
Posts: 9
Reputation:
Rep Power: 0
Solved Threads: 0
I'm having a dilema with bsave, my graphic array is 32x32 pixels in screen mode 7 and I'm using this formula to get the amount of bytes for the DIM statement
bytes= (4 + int(((width)*(bitsperpixel/bitplanes)+7)/8)*bitplanes*height) /2
(4+int((32)*(4/4)+7)/8)*4*32)/2=258
if I use this amount for the dim statement and if I use get, to get the 32x32 pixels and then put them somewhere else it works fine, so 258 works fine. BUT when I Bsave this same array I have to use double that amount + 1, 513 otherwise it won't work. I have searched alot on the internet for more info on this but it seems everyone has a different formula or method to bsave a graphic array, some say its width * height /2 +1, other say its the forumula I used without the /2, so why do I need to double my arraysize for bsave? I can't think why it needs to be double, does anyone know the exact formulas for the array and for bsaving?
its not that my current settings don't work they do, (array=258, bsave length 513) I can't understand why the amount I have work, and why there are so many different opinions on what the correct forumla is.
bytes= (4 + int(((width)*(bitsperpixel/bitplanes)+7)/8)*bitplanes*height) /2
(4+int((32)*(4/4)+7)/8)*4*32)/2=258
if I use this amount for the dim statement and if I use get, to get the 32x32 pixels and then put them somewhere else it works fine, so 258 works fine. BUT when I Bsave this same array I have to use double that amount + 1, 513 otherwise it won't work. I have searched alot on the internet for more info on this but it seems everyone has a different formula or method to bsave a graphic array, some say its width * height /2 +1, other say its the forumula I used without the /2, so why do I need to double my arraysize for bsave? I can't think why it needs to be double, does anyone know the exact formulas for the array and for bsaving?
its not that my current settings don't work they do, (array=258, bsave length 513) I can't understand why the amount I have work, and why there are so many different opinions on what the correct forumla is.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Graphics cards question? (Monitors, Displays and Video Cards)
- Graphics T and L support (Monitors, Displays and Video Cards)
- XP and Graphics card problems (Windows NT / 2000 / XP / 2003)
- getting graphics into c++ (C++)
- graphics card (Monitors, Displays and Video Cards)
- recommendations 4 a 3D graphics prog? (Graphics and Multimedia)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Is there any way that VB can force Windows not to modify a file
- Next Thread: End of File Paste-Newbie Question


Linear Mode