Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

diff. sizes of pics in a general field

Status
Not open for further replies.

torturedmind

Programmer
Jan 31, 2002
1,052
PH
hi. good day to all.

i've got this problem in one of the free tables endorsed to my by a former programmer that contains different sizes of jpegs in a general field. my question is: how can i, thru code, resize the large ones so that they're the same size with the smallest. btw, the smallest image dimension found is 640 x 480 but some are as large as 1600 x 1200.

any help is very much appreciated. peace! [peace]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
Torturedmind:

On your OLEBoundControl you need to set a couple of properties (this can be done in code, or at the Object Level if you're using your form designer.)

First, establish your control, and the size you want it.
Then:

This.AutoSize = .T.

To keep them "Retaining their basic shape", set:

This.Stretch = 1

Which keeps them "Isometric"
or

This.Stretch = 2

Which makes them "Fill the frame" enterly, but may strecth them vertically or horizontally, depending on the image.

One thing you may want to consider is setting up a control for "Horizontal" and one for "Vertical", and make it .Visible as needed, based on whether the image's size is Taller or Wider (portrate or landscape).

Good luck.



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
You can isometrically stretch an image up or down (as Scott suggests) but if you are talking about modifying the actual size of the image file, you cannot do this with native VFP.

I deal with a lot of image files and I NEVER use a general field. Too much OLE corruption. If you have to store the images in a table use a memo field and FILETOSTR()/STRTOFILE() to store/retrieve the images. Better still, store the path and filename in your table and leave the image files where they are. Remember, VFP has a 2GIG file size limit that you can run into very quickly when storing image files in a dbf.

Ken
 
Agree with Ken 100% about NOT using GENERAL fields. I'm also no fan of FILETOSTR() and vice versa. Takes too long if you have a lot of images. He is also right about actual resizing of images to the same size, but I didn't think that was your real objective... just making them "Appear" the same size?



Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
thank you all for responding.
...but if you are talking about modifying the actual size of the image file, you cannot do this with native VFP.
this is actually what i wanted to do but since you mentioned i cannot do it natively in vfp then i guess i just have to tell my encoders to begin extracting the images and resize them manually.

the former programmer left me with this kind of setup so there's not much i can do about it but to extract each image and save them to a file which my program can reference.

thanks all for the responses. peace! [peace]

kilroy [knight]
philippines

"Once a king, always a king. But being a knight is more than enough."
 
Kilroy,
Well, I'd ask why... if you use the methods we descirbed for displaying them, and they are all displayed at the same size, why is it necessary to resize them? Sure, they will take up a bit more drive space, but there is no need to resize them physically. This is why the stretch feature exists... but if you have some need for the images to be the same size outside of VFP, then yes. Note that there are tools on the internet that you can get that will resize them for you, and it can be automated to meet your image size needs. Can't remember off the top of my head because it has been a long time since I needed to do the same thing, but just go poke around Google, and you'll find them.


Best Regards,
Scott

"Everything should be made as simple as possible, and no simpler."[hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top