User Name Password Register
DaniWeb IT Discussion Community
All
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 402,622 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 2,211 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: 3821 | Replies: 4
Reply
Join Date: Oct 2005
Posts: 45
Reputation: jto is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
jto jto is offline Offline
Light Poster

is it possible to change the size of jpg file through programming in vb

  #1  
Nov 10th, 2005
i have different sige of photo files which was scanned through a scaner and save as *.jpg file , now i want to use all this files in a form made in vb6 where i want to link all these files trough data base so that i can see each photos one by one . but these file has different width and hight but in my form i have make a fix space , so i want to make all these photo files of same width and hight to fit and defined space . but i want this through some program , because this photos are approx. 40000. so manually is not possible. pls help me.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Dec 2004
Location: Lincoln Park, Michigan
Posts: 1,744
Reputation: Comatose is an unknown quantity at this point 
Rep Power: 7
Solved Threads: 107
Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Moderator

Re: is it possible to change the size of jpg file through programming in vb

  #2  
Nov 10th, 2005
Yes, But it's a lot more detailed and complex than you might think. Basically, I've devised a way using the API (StretchBlt) That shows how you can copy an image from a picture box, to another picturebox, changing size from one to the other. A Few things to note, is that the quality diminishes during this process (quality of the picture) AND the picture must be visible in order to copy from it. This project loads an image into form2, and when you click the button, makes form2 visible (makes the picture visible), and then copies it to the picturebox on form1, and then hides form2.

As you can see, this would be intensive on the processor, and probably take up quite a bit of RAM. I'm still devising a way to use objects or API Calls to specific graphic programs that would allow for better picture quality and faster processing, but for now, this is how to use the stretchblt API.
Attached Files
File Type: zip StretchBlt.zip (31.8 KB, 61 views)
Reply With Quote  
Join Date: Oct 2005
Posts: 45
Reputation: jto is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
jto jto is offline Offline
Light Poster

Re: is it possible to change the size of jpg file through programming in vb

  #3  
Nov 11th, 2005
thank u Comatose
it is nice solution , but i want in my project that first i will make all the available jpg files of same size than i will use these files in my project form directly by applying simply a path of that file , so i need that type of converter which will make all available jpg file to same size
Reply With Quote  
Join Date: Dec 2004
Posts: 207
Reputation: Real-tiner is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 7
Real-tiner Real-tiner is offline Offline
Posting Whiz in Training

Re: is it possible to change the size of jpg file through programming in vb

  #4  
Dec 7th, 2005
Originally Posted by jto
i have different sige of photo files which was scanned through a scaner and save as *.jpg file , now i want to use all this files in a form made in vb6 where i want to link all these files trough data base so that i can see each photos one by one . but these file has different width and hight but in my form i have make a fix space , so i want to make all these photo files of same width and hight to fit and defined space . but i want this through some program , because this photos are approx. 40000. so manually is not possible. pls help me.

Two thoughts.

- Change the size in a photo editor.

- Make a blank (white or black) space larger than the photo, then do the equivalent of pasting the photo into it.
Reply With Quote  
Join Date: Oct 2005
Location: Charlotte,NC
Posts: 92
Reputation: Kegtapper is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 2
Kegtapper's Avatar
Kegtapper Kegtapper is offline Offline
Junior Poster in Training

Re: is it possible to change the size of jpg file through programming in vb

  #5  
Dec 8th, 2005
Originally Posted by Real-tiner
Two thoughts.

- Change the size in a photo editor.

- Make a blank (white or black) space larger than the photo, then do the equivalent of pasting the photo into it.
There was a program called WINJPEG (shareware) where you could batch reduce. Set the size you wanted the photos and walk away. MAINTAIN Aspect RATIOS!! for sharper output images.

I would make a blank square. where the photos could fit, landscape or portrait. Paste all into blank square , then batch resize.

Watch for compression change. some will compress original too much and you have a lot of 'jaggies' or unusable image. (Keep at 100% for your existing quality)

I had to place over 3000 images of albums in The Complete Motown www.kegtapper.net/TCMC and it was a learning experience. Though I only had to work with smaller sized images.
Last edited by Kegtapper : Dec 8th, 2005 at 9:06 am. Reason: spelling error
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Visual Basic 4 / 5 / 6 Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Visual Basic 4 / 5 / 6 Forum

All times are GMT -4. The time now is 1:20 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC