1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <job>
<reference object="WIA.DeviceManager" />
<object id="DeviceManager1" progid="WIA.DeviceManager" />
<object id="CommonDialog1" progid="WIA.CommonDialog" />
<script language="VBScript">
Dim Img1
Dim IP
Dim wiaFormatJPEG
'Création conteneur pour l'image à manipuler
Set Img1 = CreateObject("WIA.ImageFile")
'Chargement de l'image dans le conteneur 375 K
Img1.LoadFile ("C:\PersoFrancis\ClusesEnviron2.bmp")
'Création du gestionnaire de filtre
Set IP = CreateObject("WIA.ImageProcess")
wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"
IP.Filters.Add IP.FilterInfos("Convert").FilterID
IP.Filters(1).Properties("FormatID").Value = wiaFormatJPEG
IP.Filters(1).Properties("Quality").Value = 90
Set Img1 = IP.Apply(Img1)
'sauvegarde de l'image au format JPG => 38.7 K
Img1.SaveFile ("C:\PersoFrancis\ClusesEnviron3.jpg")
</script>
</job> |