Jason Lee Hayes
Active member
- Local time
- Today, 21:56
- Joined
- Jul 25, 2020
- Messages
- 214
Hi,
I am curious; is it possible to change an image to Black & White maybe using WIA and the Filter?
I have found this link:-
Unfortunately i cannot get it implemented with modification into my project...
I also have an issue with the following line from the code below:-
v(i) = &HFFFF00FF 'opaque pink (A=255,R=255,G=0,B=255)
& is causing the issue; i believe this has been interpreted incorrectly through the browser and should by &..
Any help is appreciated.
Regards,
Jason
I am curious; is it possible to change an image to Black & White maybe using WIA and the Filter?
I have found this link:-
Unfortunately i cannot get it implemented with modification into my project...
I also have an issue with the following line from the code below:-
v(i) = &HFFFF00FF 'opaque pink (A=255,R=255,G=0,B=255)
& is causing the issue; i believe this has been interpreted incorrectly through the browser and should by &..
Any help is appreciated.
Regards,
Jason
![learn.microsoft.com](https://learn.microsoft.com/en-us/media/open-graph-image.png)
How to Use Filters
This topic provides examples that show how to use each of the filters available with the Windows Image Acquisition (WIA) Automation Layer.
learn.microsoft.com
Code:
Dim Img 'As ImageFile
Dim IP 'As ImageProcess
Dim v 'As Vector
Dim i 'As Long
Set Img = CreateObject("WIA.ImageFile")
Set IP = CreateObject("WIA.ImageProcess")
Img.LoadFile "C:\WINDOWS\Web\Wallpaper\Bliss.bmp"
Set v = Img.ARGBData
For i = 1 To v.Count Step 21
v(i) = &HFFFF00FF 'opaque pink (A=255,R=255,G=0,B=255)
Next
IP.Filters.Add IP.FilterInfos("ARGB").FilterID
Set IP.Filters(1).Properties("ARGBData") = v
Set Img = IP.Apply(Img)
Img.SaveFile "C:\WINDOWS\Web\Wallpaper\BlissARGB.bmp"
Last edited: