Page 1 of 1

Virtual Bin w/ CatchImage w/ Non-BMPs? + NULL! + More!

Posted: Sat Oct 23, 2004 7:29 pm
by Shannara
1.) Anybody ever got this working? I do have the up-todate CatchImage library and it works great with BMPs, but how do we catch JPGs and PNGs? When I tried (using the jpeg decoder before hand), w/ #PB_ANY, it returns a valid image number, but no valid image (it's all black).

2.) Is there a way to tell if the resulting image from catch image (used with vbin) is a NULL? The program always errors out if it returnsd a NULL, and I think it would be quite helpfull to find out if a image is null'd or not gracefully. w/o having to list the entire contents of a packed file (as packed files can be huge).

3.) I have asked this of Paul via PM, but he never answered, so I am going to ask here... If you look at the VBIn maker, it returns both compressed and uncompressed size of a packed file, yet there are no functions in the library to find the compressed size of a packed file. However, his program DOES show such a thing. Anybody know how to do this?

Posted: Wed Nov 03, 2004 5:14 am
by Paul
1. You didn't supply any code so I can't say what you are doing wrong... but it works fine here using both Constants and #PB_Any. Here's an example:
http://www.reelmedia.org/test/vtest.zip

2. You're the one who created the VBin, you're suppose to know what files are in it and what the proper names are :)
Anyway, if you want to test for problems then do a check first. VBin returns 0 if it fails...

Code: Select all

result=VBin("vtest.bin","badfilename.bmp","")
If result
  image=CatchImage(#PB_Any,result)
  Else
  MessageRequester("Error","Error Loading File")
EndIf
3. There is no function in the library to return compressed size because there was never a need for it (unless your using the library to make a ZIP clone?) To extract data from a VBin the most you would ever need is the original file size. If I ever get some free time I could try and add that feature if it's really nessesary.

Posted: Wed Nov 03, 2004 7:23 am
by Shannara
Thank ye for your help :) I'll post up some code, it works nicely with BMPs but with PNG and JPEGs it will not work for me :( I'll post some code w/i 24hours :)

Posted: Wed Nov 03, 2004 8:53 pm
by DoubleDutch
I reckon (from this and your other posts) that either your installation of PureBasic is corrupted somehow, your gfx card is faulty, or maybe the Windows installation is corrupt? Try your (compiled) program on another machine - if it works as expected then you know that its not your programming - but something restricted to the runtime enviroment of your machine.
Hope this helps...
-Anthony

Posted: Thu Nov 04, 2004 12:49 am
by Shannara
Well, almost all of my other post problems have been fixed. Except for the SendNetworkString bug, and the server side issue. But everything else works now for some odd reason :) I have two dev machines at home (both XP unfortunately), and I test with both of them.


Forgot to post the code last night while home, havent been much on the computer due to lovely kids. Will try tonight.