Skip to content

Instantly share code, notes, and snippets.

@immengineer
Last active August 15, 2017 04:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save immengineer/4b25df119a638ccf7580be405ce478ff to your computer and use it in GitHub Desktop.
Save immengineer/4b25df119a638ccf7580be405ce478ff to your computer and use it in GitHub Desktop.
JAISDK PixelFormatを指定して画像取得 PixelFormatの一覧取得
private void GetPixelFormat()
{
if (null == myCamera)
{
return;
}
if (comboBox1.Items.Count > 0) comboBox1.Items.Clear();
myPixelFormatNode = myCamera.GetNode("PixelFormat");
if (myPixelFormatNode != null)
{
for (int i = 0; i < myPixelFormatNode.EnumValues.Length; i++)
{
if (myPixelFormatNode.EnumValues[i].IsAvailable)
{
comboBox1.Items.Add(myPixelFormatNode.EnumValues[i].DisplayName);
}
}
for (int i = 0; i < comboBox1.Items.Count; i++)
{
if (comboBox1.Items[i].ToString() == myPixelFormatNode.Value.ToString())
{
comboBox1.SelectedIndex = i;
}
}
}
}
@immengineer
Copy link
Author

8行目追加 これが無いとSerchButtonする毎にPixelFormatがどんどん追加されていってしまう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment