WIA 2.0 sample converted to C# (almost done, just need a little he

S

SESDev

I am trying to learn how to use Windows Image Acquisition (WIA) so that I can
use it to capture images from a webcam and process them.

I've checked out the documentation online and worked my way through the 'How
to use Filters' examples. These are all for VBScript and I want to write my
code in C# so I started by converting the samples to C# - the code is shown
below in NUnit tests; those tests marked with the Ignore attribute do not
work and I cannot figure them out. (if you do try them you will of course
need to change the image names to work on your machine).

Please help! This is just the first hurdle I've come - I've searched around
online and there is not much out there for WIA 2 (I am using Vista and
VS2008). I need to get the final tests working.

I'm sure once I get this going I'll have more questions when it comes to
working with devices.

(I've used code to capture images with DirectShow.Net, but am told that WIA
is the way things are going and want to do things the right way - hence
trying to get to grips with WIA).

Thanks in advance for your help!



The code for your reference ...

[TestFixture()]
public class MyFixture
{
private string imageFileName =
@"C:\Users\Shaun.Venus\Pictures\IMG_3623.jpg";
private string stampImageFileName =
@"C:\Users\Shaun.Venus\Pictures\NewImage_Scale.jpg";


[Test()]
public void A_RotateImage()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();

Object ix1 = (Object)"RotateFlip";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);

Object p1 = (Object)"RotationAngle";
Object pv1 = (Object)90;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);

img = ip.Apply(img);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_RotateFlip.jpg", img);
}

[Test()]
public void B_CropImage()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();

Object ix1 = (Object)"Crop";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);

Object p1 = (Object)"Left";
Object pv1 = (Object)(img.Width/4);
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);
Object p2 = (Object)"Top";
Object pv2 = (Object)(img.Height / 4);
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);
Object p3 = (Object)"Right";
Object pv3 = (Object)(img.Width / 4);
ip.Filters[1].Properties.get_Item(ref p3).set_Value(ref pv3);
Object p4 = (Object)"Bottom";
Object pv4 = (Object)(img.Height / 4);
ip.Filters[1].Properties.get_Item(ref p4).set_Value(ref pv4);

img = ip.Apply(img);

SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Crop.jpg",
img);
}


[Test()]
public void C_ScaleImage()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);


WIA.ImageProcess ip = new WIA.ImageProcess();

Object ix1 = (Object)"Scale";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);


Object p1 = (Object)"MaximumWidth";
Object pv1 = (Object)250;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);
Object p2 = (Object)"MaximumHeight";
Object pv2 = (Object)250;
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);


img = ip.Apply(img);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Scale.jpg", img);
}



[Test()]
public void D_StampImage()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageFile img2 = new WIA.ImageFile();
img2.LoadFile(stampImageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();

Object ix1 = (Object)"Stamp";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);

Object p1 = (Object)"ImageFile";
Object pv1 = (Object)img2;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);

Object p2 = (Object)"Left";
Object pv2 = (Object)(img.Width - img2.Width);
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);
Object p3 = (Object)"Top";
Object pv3 = (Object)(img.Height - img2.Height);
ip.Filters[1].Properties.get_Item(ref p3).set_Value(ref pv3);


img = ip.Apply(img);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Stamp.jpg", img);
}



[Test()]
[Ignore()]
public void E_ExifFilter_WriteTextToImage()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();

WIA.Vector vector = new WIA.Vector();

Object ix1 = (Object)"Exif";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);

Object p1 = (Object)"ID";
Object pv1 = (Object)40091;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);
Object p2 = (Object)"Type";
Object pv2 =
(Object)WIA.WiaImagePropertyType.VectorOfBytesImagePropertyType;
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);

String title = "This 'Title' was added using WIA 2.0";
Boolean resizable = true;
Boolean unicode = true;
vector.SetFromString(title, resizable, unicode);

img = ip.Apply(img);

SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Exif.jpg",
img);
}



[Test()]
[Ignore()]
public void F_FrameFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageFile page2 = new WIA.ImageFile();
page2.LoadFile(@"C:\Users\Shaun.Venus\Pictures\IMG_3582.jpg");

WIA.ImageFile page3 = new WIA.ImageFile();
page3.LoadFile(@"C:\Users\Shaun.Venus\Pictures\IMG_3583.jpg");

WIA.ImageProcess ip = new WIA.ImageProcess();

Object ix1 = (Object)"Frame";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, ip.Filters.Count);
Object p1 = (Object)"ImageFile";
Object pv1 = (Object)page2;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p1).set_Value(ref pv1);

Object ix2 = (Object)"Frame";
WIA.FilterInfo fi2 = ip.FilterInfos.get_Item(ref ix2);
ip.Filters.Add(fi2.FilterID, ip.Filters.Count);
Object p2 = (Object)"ImageFile";
Object pv2 = (Object)page3;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p2).set_Value(ref pv2);

Object ix3 = (Object)"Convert";
WIA.FilterInfo fi3 = ip.FilterInfos.get_Item(ref ix3);
ip.Filters.Add(fi3.FilterID, ip.Filters.Count);
Object p3 = (Object)"FormatID";
Object pv3 = (Object)WIA.FormatID.wiaFormatTIFF;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p3).set_Value(ref pv3);

img = ip.Apply(img);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Frame.jpg", img);

img.ActiveFrame = img.FrameCount;

WIA.Vector v = img.ARGBData;

img = v.get_ImageFile(img.Width, img.Height);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Frame.bmp", img);

}


[Test()]
[Ignore()]
public void G_ARGBFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();

WIA.Vector v = img.ARGBData;

for (int i = 0; i < v.Count; i = i + 21)
{
if (i < v.Count)
{
//v = 0xFFFF00FF;
}
}

Object ix1 = (Object)"ARGB";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);

Object p1 = (Object)"ARGBData";
Object pv1 = (Object)v;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);

img = ip.Apply(img);

SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_ARGB.jpg",
img);
}


[Test()]
public void H_Convert()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);

WIA.ImageProcess ip = new WIA.ImageProcess();


Object ix1 = (Object)"Convert";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, ip.Filters.Count);
Object p1 = (Object)"FormatID";
Object pv1 = (Object)WIA.FormatID.wiaFormatBMP;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p1).set_Value(ref pv1);
Object p2 = (Object)"Quality";
Object pv2 = (Object)5;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p2).set_Value(ref pv2);

img = ip.Apply(img);


SaveNewImage(@"C:\Users\Shaun.Venus\Pictures\NewImage_Convert.bmp", img);
}

private void SaveNewImage(string fileName, WIA.ImageFile img)
{
File.Delete(fileName);
img.SaveFile(fileName);
}

}
 
T

Tim Roberts

SESDev said:
I am trying to learn how to use Windows Image Acquisition (WIA) so that I can
use it to capture images from a webcam and process them.

Good luck. In Vista, Microsoft (for reasons that are entirely unclear to
me) stopped supplying their automatic WIA layer for streaming web cameras,
so the only way you'll get WIA support is if the manufacturer provides one.
Few do, at this point.
(I've used code to capture images with DirectShow.Net, but am told that WIA
is the way things are going and want to do things the right way - hence
trying to get to grips with WIA).

Well, it depends on what you are trying to do. If you have a webcam that
takes still shots while unplugged and stores them, then WIA is probably the
right way to fetch those stored shots. But if you are trying to snatch
images from a streaming webcam, then WIA simply won't do it in Vista and
beyond. In that case, DirectShow is BY FAR the most flexible and widely
supported method to access it.
The code for your reference ...

Does this code actually work with your camera? Can you tell me which
camera you are using?
 
C

Colbert Zhou [MSFT]

Hello SES,

Thanks for your posting in Microsoft managed newsgroup, this is Colbert
Zhou MSFT and I will be working on this issue with you!

I take this issue as my first priority to resolve today. And after a long
research and test, I have make all of them work. The following are detailed
information.

For the first Ignore method E_ExifFilter_WriteTextToImage, after comparing
the VB codes version in MSDN document, I find that we lost this line of
codes,
IP.Filters(1).Properties("Value").let_Value(v)

So after add this line and translate it into C#, the following codes work,
[TestMethod()]
public void E_ExifFilter_WriteTextToImage()
{
WIA.ImageFile img = new WIA.ImageFile();
WIA.ImageProcess ip = new WIA.ImageProcess();
WIA.Vector vector = new WIA.Vector();

img.LoadFile(imageFileName);

Object ix1 = (Object)"Exif";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);//sec

Object p1 = (Object)"ID";
Object pv1 = (Object)40091;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);

Object p2 = (Object)"Type";
Object pv2 =
(Object)WIA.WiaImagePropertyType.VectorOfBytesImagePropertyType;
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);

String title = "This 'Title' was added using WIA 2.0";
Boolean resizable = true;
Boolean unicode = true;
vector.SetFromString(title, resizable, unicode);

Object p3 = (Object)"Value";
Object pv3 = (Object)vector;
ip.Filters[1].Properties.get_Item(ref p3).set_Value(ref pv3);

img = ip.Apply(img);


SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Exif.jpg",img);
}

For the second Ignore method F_FrameFilter, I find that the VB version
codes did not specify the second parameter of ImageProcess.Filters.Add()
method. But our C# codes specify the ip.Filters.Count for it. Actually I
use the ILDASM to compare the VB and C# version il codes, I find that VB
indeed uses 0 for the second parameter. So after changing them to 0, the
following codes work fine,
[TestMethod()]
public void F_FrameFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);
WIA.ImageFile page2 = new WIA.ImageFile();
page2.LoadFile(@"C:\Users\v-jzho\Desktop\P1010009.JPG");
WIA.ImageFile page3 = new WIA.ImageFile();
page3.LoadFile(@"C:\Users\v-jzho\Desktop\P1010011.JPG");
WIA.ImageProcess ip = new WIA.ImageProcess();
Object ix1 = (Object)"Frame";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);
Object p1 = (Object)"ImageFile";
Object pv1 = (Object)page2;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p1).set_Value(ref pv1);
Object ix2 = (Object)"Frame";
WIA.FilterInfo fi2 = ip.FilterInfos.get_Item(ref ix2);
ip.Filters.Add(fi2.FilterID, 0);
Object p2 = (Object)"ImageFile";
Object pv2 = (Object)page3;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p2).set_Value(ref pv2);
Object ix3 = (Object)"Convert";
WIA.FilterInfo fi3 = ip.FilterInfos.get_Item(ref ix3);
ip.Filters.Add(fi3.FilterID, 0);
Object p3 = (Object)"FormatID";
Object pv3 = (Object)WIA.FormatID.wiaFormatTIFF;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p3).set_Value(ref pv3);
img = ip.Apply(img);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Frame.jpg", img);
img.ActiveFrame = img.FrameCount;
WIA.Vector v = img.ARGBData;
img = v.get_ImageFile(img.Width, img.Height);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Frame.bmp", img);
}

For the last Ignore method G_ARGBFilter, we need to use let_Item() method
to set the vector in C#, and the index is based on 1. So we need to
initialize i as 1. The following codes work fine.
[TestMethod()]
public void G_ARGBFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(@"C:\Users\v-jzho\Desktop\P1010007.JPG");
WIA.ImageProcess ip = new WIA.ImageProcess();
WIA.Vector v = img.ARGBData;
int i;
for (i = 1; i < v.Count; i = i + 21)
{
if (i < v.Count)
{
object val = 0xFFFF00FF;
v.let_Item(i, ref val);
}
}
Object ix1 = (Object)"ARGB";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);
Object p1 = (Object)"ARGBData";
Object pv1 = (Object)v;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);
img = ip.Apply(img);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_ARGB.jpg", img);
}

I have tested all codes above and they work. Could you please give it a try
and let me know your result? If you have any future questions or concerns,
please feel free to let me know and I will give a follow up support!

Have a nice day!


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

SESDev

Hi Tim,

Thanks for the response. Initially I just wanted to work out how to use WIA
to process images in C#, then it's on to the camera side of things.

I will try that once I have the image processing code down - I'll reply to
this post to say how I get on with it all.
 
S

SESDev

Thanks very much for looking into that for me - that explains it for me!

Now I will try to get a camera working so I can capture pictures from the
stream - do you have samples of that?

I've got it working in DirectShow, but as I've read that WIA is the MS
recommended method I wanted to use it (or will we be moving to Media
Framework?).


--
SES Development



Colbert Zhou said:
Hello SES,

Thanks for your posting in Microsoft managed newsgroup, this is Colbert
Zhou MSFT and I will be working on this issue with you!

I take this issue as my first priority to resolve today. And after a long
research and test, I have make all of them work. The following are detailed
information.

For the first Ignore method E_ExifFilter_WriteTextToImage, after comparing
the VB codes version in MSDN document, I find that we lost this line of
codes,
IP.Filters(1).Properties("Value").let_Value(v)

So after add this line and translate it into C#, the following codes work,
[TestMethod()]
public void E_ExifFilter_WriteTextToImage()
{
WIA.ImageFile img = new WIA.ImageFile();
WIA.ImageProcess ip = new WIA.ImageProcess();
WIA.Vector vector = new WIA.Vector();

img.LoadFile(imageFileName);

Object ix1 = (Object)"Exif";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);//sec

Object p1 = (Object)"ID";
Object pv1 = (Object)40091;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);

Object p2 = (Object)"Type";
Object pv2 =
(Object)WIA.WiaImagePropertyType.VectorOfBytesImagePropertyType;
ip.Filters[1].Properties.get_Item(ref p2).set_Value(ref pv2);

String title = "This 'Title' was added using WIA 2.0";
Boolean resizable = true;
Boolean unicode = true;
vector.SetFromString(title, resizable, unicode);

Object p3 = (Object)"Value";
Object pv3 = (Object)vector;
ip.Filters[1].Properties.get_Item(ref p3).set_Value(ref pv3);

img = ip.Apply(img);


SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Exif.jpg",img);
}

For the second Ignore method F_FrameFilter, I find that the VB version
codes did not specify the second parameter of ImageProcess.Filters.Add()
method. But our C# codes specify the ip.Filters.Count for it. Actually I
use the ILDASM to compare the VB and C# version il codes, I find that VB
indeed uses 0 for the second parameter. So after changing them to 0, the
following codes work fine,
[TestMethod()]
public void F_FrameFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(imageFileName);
WIA.ImageFile page2 = new WIA.ImageFile();
page2.LoadFile(@"C:\Users\v-jzho\Desktop\P1010009.JPG");
WIA.ImageFile page3 = new WIA.ImageFile();
page3.LoadFile(@"C:\Users\v-jzho\Desktop\P1010011.JPG");
WIA.ImageProcess ip = new WIA.ImageProcess();
Object ix1 = (Object)"Frame";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);
Object p1 = (Object)"ImageFile";
Object pv1 = (Object)page2;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p1).set_Value(ref pv1);
Object ix2 = (Object)"Frame";
WIA.FilterInfo fi2 = ip.FilterInfos.get_Item(ref ix2);
ip.Filters.Add(fi2.FilterID, 0);
Object p2 = (Object)"ImageFile";
Object pv2 = (Object)page3;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p2).set_Value(ref pv2);
Object ix3 = (Object)"Convert";
WIA.FilterInfo fi3 = ip.FilterInfos.get_Item(ref ix3);
ip.Filters.Add(fi3.FilterID, 0);
Object p3 = (Object)"FormatID";
Object pv3 = (Object)WIA.FormatID.wiaFormatTIFF;
ip.Filters[ip.Filters.Count].Properties.get_Item(ref
p3).set_Value(ref pv3);
img = ip.Apply(img);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Frame.jpg", img);
img.ActiveFrame = img.FrameCount;
WIA.Vector v = img.ARGBData;
img = v.get_ImageFile(img.Width, img.Height);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_Frame.bmp", img);
}

For the last Ignore method G_ARGBFilter, we need to use let_Item() method
to set the vector in C#, and the index is based on 1. So we need to
initialize i as 1. The following codes work fine.
[TestMethod()]
public void G_ARGBFilter()
{
WIA.ImageFile img = new WIA.ImageFile();
img.LoadFile(@"C:\Users\v-jzho\Desktop\P1010007.JPG");
WIA.ImageProcess ip = new WIA.ImageProcess();
WIA.Vector v = img.ARGBData;
int i;
for (i = 1; i < v.Count; i = i + 21)
{
if (i < v.Count)
{
object val = 0xFFFF00FF;
v.let_Item(i, ref val);
}
}
Object ix1 = (Object)"ARGB";
WIA.FilterInfo fi1 = ip.FilterInfos.get_Item(ref ix1);
ip.Filters.Add(fi1.FilterID, 0);
Object p1 = (Object)"ARGBData";
Object pv1 = (Object)v;
ip.Filters[1].Properties.get_Item(ref p1).set_Value(ref pv1);
img = ip.Apply(img);

SaveNewImage(@"C:\Users\v-jzho\Desktop\output\NewImage_ARGB.jpg", img);
}

I have tested all codes above and they work. Could you please give it a try
and let me know your result? If you have any future questions or concerns,
please feel free to let me know and I will give a follow up support!

Have a nice day!


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/en-us/subscriptions/aa948868.aspx#notifications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://support.microsoft.com/select/default.aspx?target=assistance&ln=en-us.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 
C

Colbert Zhou [MSFT]

Hi,

I have found a very good sample in a MSFT blog article. Please give it a
look at,
http://blogs.msdn.com/coding4fun/archive/2006/10/31/912546.aspx.

Hope that sample helps you to get a start. Have a good day!


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
C

Colbert Zhou [MSFT]

Thanks for your comment, Tim. You are right!

"On Windows Vista, the camera image import functionality of the Scanner and
Camera Wizard is replaced by the Photo Acquisition Wizard and the Windows
Photo Gallery. This is also known as the "Importing Pictures and Videos"
dialog. The Photo Acquisition wizard communciates to PTP cameras using WPD
APIs (more specifically, it uses the WPD Namespace Extension). It does
not use the WIA APIs." So, we are using WPD(Windows Portable Devices) APIs
to do this job in Vista.

For detailed information, please refer
http://blogs.msdn.com/wpdblog/archive/2007/02/13/migrating-from-wia-to-wpd.a
spx.

Good weekend to both of you! :)


Best regards,
Colbert Zhou (colbertz @online.microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).
 
C

Colbert Zhou [MSFT]

Hello,

I am writing to check the status of the issue on your side. Is there any
future support we can provide from our side? If yes, please do not hesitate
to let me know!

Have a great day!

Best regards,
Colbert Zhou ([email protected], remove 'online.')
Microsoft Online Community Support

=================================================
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

This posting is provided "AS IS" with no warranties, and confers no rights.
=================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Problem with ADF and WIA 0

Top