completetore.blogg.se

Imagemagick resize image
Imagemagick resize image




imagemagick resize image

The function will return True when the Resize operation is successful and False in all other cases. , vbOKOnly + vbCritical, "An Error has Occurred!" If Not oWIA Is Nothing Then Set oWIA = Nothing If Not oIP Is Nothing Then Set oIP = Nothing WIA_ResizeImage = True Error_Handler_Exit: OIP.Filters(1).Properties("MaximumHeight") = lMaximumHeight oWIA.LoadFile sInitialImage OIP.Filters(1).Properties("MaximumWidth") = lMaximumWidth Set oIP = CreateObject("WIA.ImageProcess") oIP.FilterInfos("Scale").FilterID LMaximumWidth As Long, lMaximumHeight As Long) As Booleanĭim oIP As Object 'ImageProcess Set oWIA = CreateObject("WIA.ImageFile") Public Function WIA_ResizeImage(sInitialImage As String, sResizedImage As String, _ ' Call WIA_ResizeImage("C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg", _ ' lMaximumHeight: Maximum allowable image height

imagemagick resize image

' lMaximumWidth : Maximum allowable image width ' sResizedImage : Fully qualified path and filename of where to save the resized image

imagemagick resize image

' sInitialImage : Fully qualified path and filename of the original image to resize ' Req'd Refs: Uses Late Binding, so none required It may not be sold/resold or reposted on other sites (links ' copyright notice is left unchanged (including Author, Website and ' Copyright : The following may be altered and reused as you wish so long as the ' Purpose : Resize an image based on Max width and Max height using WIA ' Author : Daniel Pineault, CARDA Consultants Inc. , vbOKOnly + vbCritical, "An Error has Occurred!" Resume Error_Handler_Exit Switch(Erl = 0, "", Erl 0, vbCrLf & "Line No: " & Erl) _ "Error Description: " & Err.Description & _ "Error Source: WIA_ResizeImage" & vbCrLf & _ "Error Number: " & Err.Number & vbCrLf & _ MsgBox "The following error has occurred" & vbCrLf & vbCrLf & _ On Error Resume Next If Not oIP Is Nothing Then Set oIP = Nothing If Not oWIA Is Nothing Then Set oWIA = Nothing Exit Function OIP.Filters(1).Properties( "MaximumHeight") = lMaximumHeight OIP.Filters(1).Properties( "MaximumWidth") = lMaximumWidth Set oIP = CreateObject( "WIA.ImageProcess") LMaximumWidth As Long, lMaximumHeight As Long) As Boolean On Error GoTo Error_Handlerĭim oWIA As Object 'WIA.ImageFile Dim oIP As Object 'ImageProcess Set oWIA = CreateObject( "WIA.ImageFile") ' "C:\Users\MyUser\Desktop\Chrysanthemum_small.jpg", _

IMAGEMAGICK RESIZE IMAGE WINDOWS

' Req'd Refs: Uses Late Binding, so none required ' ' Windows Image Acquisition (WIA) ' (v=vs.85).aspx ' ' Input Variables: ' ~~~~~~~~~~~~~~~~ ' sInitialImage : Fully qualified path and filename of the original image to resize ' sResizedImage : Fully qualified path and filename of where to save the resized image ' lMaximumWidth : Maximum allowable image width ' lMaximumHeight: Maximum allowable image height ' ' Usage: ' ~~~~~~ ' Call WIA_ResizeImage("C:\Users\Public\Pictures\Sample Pictures\Chrysanthemum.jpg", _ It may not be sold/resold or reposted on other sites (links ' back to this site are allowed). ' Website : ' Purpose : Resize an image based on Max width and Max height using WIA ' Copyright : The following may be altered and reused as you wish so long as the ' copyright notice is left unchanged (including Author, Website and ' Copyright). '- ' Procedure : WIA_ResizeImage ' Author : Daniel Pineault, CARDA Consultants Inc.






Imagemagick resize image