|
-
Apr 2nd, 2001, 03:28 AM
#1
Thread Starter
Junior Member
I would like to save an image in VB 6 in the least possible format.
I would be thankful if anyone could help me in giving the method of saving the image and also any possible way to compress the image to the maximum possible extent and store it in a database.
Thanking you
Sreedhar
-
Apr 2nd, 2001, 05:09 AM
#2
Fanatic Member
Take a look at this: http://psprogramming.virtualave.net/...7/dd/zlib.html
Ignore the DirectDraw part and download only the zlib.dll and the compression program (which includes source)...
It uses zlib.dll to compress byte arrays, allowing it to be stored inside a database and reading it again without using a temporary file...
Good luck!
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Apr 2nd, 2001, 06:01 AM
#3
Thread Starter
Junior Member
Thanks for the help
Thanks a lot for the help, i am downloading the file, i will go through it. I download zlib_compress.zip but it isn't of much use but the .dll i hope it is.
Thanks a lot and if any doubts i will ask you.
-
Apr 3rd, 2001, 12:58 AM
#4
Thread Starter
Junior Member
The zlib.dll is not working. I am getting an error saying that the zlib.dll is not found so i tried to register the dll which failed.
Can you tell me an alternative to this or am i doing anything wrong.
Thank you
-
Apr 3rd, 2001, 02:10 AM
#5
Fanatic Member
The DLL must be in the same path of your program, or (which should work for sure) put it in your Windows\System path...
Included with the zlib_compress.zip are two class modules. One which handles the zLib.dll and the other one which is used to compress a bitmap (this had been designed for bitmaps only, not JPGs, because bitmaps are not yet compressed and can be read from a byte array to be blitted onto a picturebox or form).
It's not extremely difficult to change the zlib_compress.zip example to work with a database, as long as you know how to store byte arrays. I normally create a field of the type dbLongBinary (or OLE_???? in Access if I'm correct)...
If you need any more help or sample code, just leave a message here...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Apr 3rd, 2001, 05:38 AM
#6
Thread Starter
Junior Member
Compression of images not satisfactory
PsychoMark
Thanks a lot for the code. But the compression is not coming to the level i expected and it is infact quite more than .jpeg images.
I wanted something which compresses files more than the .jpeg images.
If you can help me i shall be thankful to you
-
Apr 3rd, 2001, 05:42 AM
#7
transcendental analytic
JPEG is a quality reducing compression format, so you change the rate and can compress more to loose quality on the other hand.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Apr 3rd, 2001, 08:31 AM
#8
Fanatic Member
I never really tested the JPG and my own method, but I'm sure they're not that different. Especially if you want to keep the quality (like kedaman said, JPGs look awful if you compress them a lot), and I needed the quality for DirectDraw...
I think you'll have to make a choice between quality and size (unfortunately, VB doesn't support the PNG format, but I've heard the PNG format uses something similar to my zLib sample )...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Apr 3rd, 2001, 11:29 PM
#9
Thread Starter
Junior Member
My main requirement is like this, we are developing a component using scanner which scans the image and stores the image. My colleagues have developed the component but the size of the file is quite big which is of A4 size. I have been assigned the task to see to it that i can reduce the size of the image to the maximum possible extent.
If possible i would like a component to convert the bmp's into jpg's and compress them into a readable or non readable format to the maximum possible extent.
If there is any component or software pls tell me
-
Apr 4th, 2001, 12:34 AM
#10
Member
You can set Jpeg quality to 1 and get the best compression rate... and one ugly pixel
-
Apr 4th, 2001, 01:01 AM
#11
Thread Starter
Junior Member
my images need not be in .jpg format they can be in .tiff ,etc. I just need the least size without much compromising on the quality
-
Apr 4th, 2001, 04:22 AM
#12
Fanatic Member
So you want an incredibly tiny file without loosing too much quality? I think that's going to be hard to find, but if anyone here knows a way, I'm interested too....
You could try to create JPG images with a reasonable quality and use RAR to compress those, but I only have the UnRAR code for that (because WinRAR only supplies an unrar.dll)...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Apr 4th, 2001, 05:34 AM
#13
Thread Starter
Junior Member
I want still smaller images
What is RAR and UNRAR.
I have used kodak components in VB and compressed a .bmp file of 2.59 mb to a minimum of 58.2 kb. But my boss wants still lesser size images. I have used jpeg compression of high compression and least quality and saved the file as .tif file.
I have heard that its possible to reduce the same file i,e A4 size image to a minimum or around 20kb which is what i am trying now.
If you know the method or any sites where such components are available can u tell me. It will be of great help.
-
Apr 4th, 2001, 05:38 AM
#14
Fanatic Member
RAR is something like Zip, only RAR is much better...
What's the difference between 52 kb and 20 kb? Ok, 30 kb I can hear you say, but does it really matter that much? You'll probably have to spend a lot of money on 3rd party components to get that kind of compression rates...
Anyways, I can't help you from this point, I can just say: good luck!
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
-
Apr 4th, 2001, 06:08 AM
#15
Thread Starter
Junior Member
Can u expand a little more on RAR and URAR and where can i get and what should i do.
As you said 50 and 20 kb isn't much but when it comes to many files which are to be stored in database its a lot.
Thanks a lot for the help.
-
Apr 4th, 2001, 06:11 AM
#16
Fanatic Member
WinRAR can be found at http://www.rarsoft.com/
I think there are some examples at http://www.planetsourcecode.com/vb/ too, or try http://www.vbaccelerator.com/ and search for the ZIP functions in the 'Libraries' section...
Teaudirenopossum.Musasapientumfixaestinaure.
(I can't hear you. There's a banana in my ear)
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
|