Skip to content

Instantly share code, notes, and snippets.

@veigr
Created February 4, 2015 05:35
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 veigr/703b419f096beef034e8 to your computer and use it in GitHub Desktop.
Save veigr/703b419f096beef034e8 to your computer and use it in GitHub Desktop.
[WinRT][SharpDX]ディスプレイプロファイルの取得
// ※物理ディスプレイがない環境だと例外を吐く
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