Last active
March 1, 2023 09:33
-
-
Save TakashiYoshinaga/b4a7e9134a26f57da3e991d46d51161a to your computer and use it in GitHub Desktop.
Initialize Bitmap for Color Image of Azure Kinect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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