Skip to content

Instantly share code, notes, and snippets.

@TakashiYoshinaga TakashiYoshinaga/Form1.cs
Last active Dec 3, 2019

Embed
What would you like to do?
Initialize Bitmap for Color Image of Azure Kinect
//Kinectを扱う変数
Device kinect;
//(追加①)カラー画像のBitmap
Bitmap colorBitmap;
public Form1()
{
InitializeComponent();
InitKinect();
//(追加②)Kinectの設定情報に基づいてBitmap関連情報を初期化
InitBitmap();
}
//(追加③)Bitmap画像に関する初期設定
private void InitBitmap()
{
//カラー画像の横幅(width)と縦幅(height)を取得
int width = kinect.GetCalibration().ColorCameraCalibration.ResolutionWidth;
int height = kinect.GetCalibration().ColorCameraCalibration.ResolutionHeight;
//PictureBoxに貼り付けるBitmap画像を作成。サイズはkinectのカラー画像と同じ
colorBitmap = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.