简体   繁体   中英

Can Aforge detect the tablet type?

Team,

I have an issue where i have to deploy the C# web cam project done with the help of Aforge classes on two tablets Pro -3 and Pro -4. Issue is that there are vast differences between the video resolutions of each of the them. I need to select 960 * 540 for Pro-3 and 640 * 640 for Pro-4.

if i know something as if(tablet is Pro-3) then set video resolution as 960 * 540 if tablet is Pro4 set video resolution as 640 * 640

is there any way i can accomplish this

Question 2)

I also have a picturebox control which seem to be bigger than the video resolution. How can i set the picturebox size and width to video resolution.

Can Aforge detect the tablet type?

I don't think it can. But it can be done in different way.

As for your first question . I don't have any of these models to check this but you should get model by executing this powershell script:

Get-WmiObject Win32_Computersystem | Format-List model

C# code for retriving Model and Manufacturer would be something like:

public static string GetDeviceManufacturerModel()
    {
        const string manufacturerKey = "Manufacturer";
        const string modelKey = "Model";

        var mos = new ManagementObjectSearcher(
            string.Format("select {0}, {1} from Win32_ComputerSystem", manufacturerKey, modelKey));

        foreach (var managementObject in mos.Get())
        {
            if (managementObject[manufacturerKey] != null && managementObject[modelKey] != null)
                return string.Format("{0} {1}", managementObject[manufacturerKey], managementObject[modelKey]);
        }
        return "";
    }

As for second question . Aforge library that you use is giving you VideoSourcePlayer , there is AutoSizeControl Property designed for achiving what you want. Maybe it's better solution for you than picturebox.

If not, check out this thread on Aforge forum : PictureBox instead of VideoSourcePlayer

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM