Created
October 28, 2016 14:38
-
-
Save nibasya/bf94f58807437b2d0ad1dd8947d5b50a to your computer and use it in GitHub Desktop.
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
CRect targetRect; | |
CImage img; | |
cv::Mat tmp; | |
pWnd->GetClientRect(&targetRect); | |
img.Create(targetRect.Width(), targetRect.Height(), 24); | |
/* snip some codes */ | |
// 画像イメージ変換 | |
tmp.create(targetRect.Height(), targetRect.Width(), CV_8UC3); | |
if(img.GetPitch()>0){ | |
memcpy(tmp.data, img.GetBits(), img.GetPitch()*img.GetHeight()); | |
} else { | |
memcpy(tmp.data, (BYTE *)img.GetBits()+img.GetPitch()*(img.GetHeight()-1), -img.GetPitch()*img.GetHeight()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment