Created
February 4, 2015 05:35
-
-
Save veigr/703b419f096beef034e8 to your computer and use it in GitHub Desktop.
[WinRT][SharpDX]ディスプレイプロファイルの取得
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
// ※物理ディスプレイがない環境だと例外を吐く | |
var profileStream = await DisplayInformation.GetForCurrentView().GetColorProfileAsync(); | |
var profileBytes = new byte[profileStream.Size]; | |
var reader = new DataReader(profileStream); | |
await reader.LoadAsync((uint)profileStream.Size); | |
reader.ReadBytes(profileBytes); | |
var factory = new ImagingFactory(); | |
var displayProfile = new ColorContext(factory); | |
displayProfile.InitializeFromMemory(DataStream.Create(profileBytes, true, false)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment