|
-
Jun 28th, 2001, 08:35 AM
#1
Thread Starter
Addicted Member
resizing image in photoshop: though!
hello,
i want to make something that can resize an image, using e.g. photoshop.
if my image is 800 x 600, then i want to resize it so that the biggest size becomes 500 (thus 500 x 375, constrain proportions)
if my image is 600x800, it will become 375 x 500.
i've tried to use photoshop and vb, but i can't manage this. i want to convert 500 pictures, so it has to be automatic.
Are there some programs who can do that (automated batch) for a lot of pictures?
or can i do it with photoshop automation, and if yes, how?
i've tried 'sendkeys' etc. to automate photoshop, but it seems that photoshop isn't understanding the keys i send. If i send "alt+i" for the image menu, a toolbar is opened instead?! but "alt+f4" is working (closes the program).
why isn't it understanding the keys?
please help!
Last edited by c@lle; Jun 29th, 2001 at 01:15 AM.
-
Jun 29th, 2001, 08:27 AM
#2
Good Ol' Platypus
This'll resize 'em using paintpicture, it's pretty slow and looks blocky. (pixel resize). I tried to use this but there's an error, I'm posting it anyway to see if you can do anything with it...
VB Code:
Function ResizeImg(ByRef tempPicBox As PictureBox, ImgFile As String) As Boolean
Dim W
Dim H
Dim nW
Dim nH
Dim AspRat
With tempPicBox
.ScaleMode = 3
.AutoSize = True
.AutoRedraw = True
.Visible = False
.Picture = LoadPicture(ImgFile)
W = .ScaleWidth
H = .ScaleHeight
End With
If W > H Then
AspRat = 500 / W
ElseIf H > W Then
AspRat = 500 / H
Else
AspRat = 500 / W
End If
nW = AspRat * W
nH = AspRat * H
tempPicBox.PaintPicture tempPicBox.Picture, 0, 0, W, H, 0, 0, nW, nH, vbSrcCopy
tempPicBox.Refresh
SavePicture tempPicBox.Image, ImgFile
End Function
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jul 13th, 2001, 03:05 AM
#3
Ok.. please correct me if I am wrong, but won't that save it as a bitmap? And 500 bitmaps would take up quite a bit of space on your hard drive, depending on how big the image dimensions are.
I recommend that you use Smaller Animals Thumbnailer, their website is SmallerAnimals.com, you can find it on the 'software' tab. You can use it for a while before you have to register, and it's pretty small and fast too.
Hope this helps,
- Aurilus.
-
Jul 13th, 2001, 10:48 AM
#4
Good Ol' Platypus
You can instead use the .image property to save it as another format, though, with a 3rd party control, or another piece of code.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jul 13th, 2001, 11:55 AM
#5
Addicted Member
Well... not in code.
But if you just need to convert 500 images once, and aren't really worried about the mechanics...
Adobe photoshop(5.5 at least, I don't know about others), has a batch processing routine.
Open up any bmp file...
Go into the actions list, next to the history in the history window.
Select the new icon from the window, resize the image to the width you want... hit stop on the action window...
Then from the file drop down select Automate->Batch
Select your action from the list of actions...
Select source and destination folder...
And you're set...
Of course, if you want to use VB to do it still, you might want to trigger a routine like this anyways...
- Dim A
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
|