Results 1 to 5 of 5

Thread: resizing image in photoshop: though!

  1. #1

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    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.

  2. #2
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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:
    1. Function ResizeImg(ByRef tempPicBox As PictureBox, ImgFile As String) As Boolean
    2. Dim W
    3. Dim H
    4. Dim nW
    5. Dim nH
    6. Dim AspRat
    7.    With tempPicBox
    8.       .ScaleMode = 3
    9.       .AutoSize = True
    10.       .AutoRedraw = True
    11.       .Visible = False
    12.       .Picture = LoadPicture(ImgFile)
    13.       W = .ScaleWidth
    14.       H = .ScaleHeight
    15.    End With
    16.    If W > H Then
    17.       AspRat = 500 / W
    18.    ElseIf H > W Then
    19.       AspRat = 500 / H
    20.    Else
    21.       AspRat = 500 / W
    22.    End If
    23.    nW = AspRat * W
    24.    nH = AspRat * H
    25.    tempPicBox.PaintPicture tempPicBox.Picture, 0, 0, W, H, 0, 0, nW, nH, vbSrcCopy
    26.    tempPicBox.Refresh
    27.    SavePicture tempPicBox.Image, ImgFile
    28. 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)

  3. #3
    Aurilus
    Guest
    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.

  4. #4
    Good Ol' Platypus Sastraxi's Avatar
    Join Date
    Jan 2000
    Location
    Ontario, Canada
    Posts
    5,134
    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)

  5. #5
    Addicted Member Dim A's Avatar
    Join Date
    Jul 2000
    Posts
    201
    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
  •  



Click Here to Expand Forum to Full Width