LoginSignup
0
0

More than 3 years have passed since last update.

vbsの作法 その48

Last updated at Posted at 2019-12-20

概要

vbsの作法調べてみた。
win10、64bitでやってみた。
wia叩いてみた。

環境

windows10 64bit

サンプルコード

Dim objImg
Dim objIp
intScaleRatio = 50
input = "C:\Users\***\Desktop\20191218065351gazo0.JPG"
output = "C:\Users\***\Desktop\gazo0.JPG"
Set objImg = CreateObject("WIA.ImageFile")
msgbox "ok"
objImg.LoadFile(input)
Set objIp = CreateObject("WIA.ImageProcess")
objIp.Filters.Add(objIp.FilterInfos("Scale").FilterID)
objIp.Filters(1).Properties("MaximumWidth").Value = objImg.Width * (intScaleRatio / 100)
objIp.Filters(1).Properties("MaximumHeight").Value = objImg.Height * (intScaleRatio / 100)
Set objImg = objIp.Apply(objImg)
objImg.SaveFile(output)
Set objImg = Nothing
Set objIp = Nothing

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0