MCPcopy Create free account
hub / github.com/HO-COOH/FastCopy / Bitmap

Method Bitmap

FastCopy/FileInfoViewModel.cpp:38–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 }
37
38 winrt::Microsoft::UI::Xaml::Media::ImageSource FileInfoViewModel::Bitmap()
39 {
40 try
41 {
42 if (auto icon = GetHBitmapFromFile(m_path.data()))
43 return HBitmapToWriteableBitmap(icon);
44 }
45 catch (...) {}
46
47 try
48 {
49 if (auto icon = GetHIconFromFile(m_path.data()))
50 return HIconToWriteableBitmap(icon);
51 }
52 catch (...) {}
53
54 winrt::Microsoft::UI::Xaml::Media::Imaging::BitmapImage image{ winrt::Windows::Foundation::Uri{L"ms-appx:///Assets/FileDefault.ico" } };
55 return image;
56 }
57
58 static std::wstring GetShellPropStringFromPath(LPCWSTR pPath, PROPERTYKEY const& key)
59 {

Callers

nothing calls this directly

Calls 5

GetHBitmapFromFileFunction · 0.85
HBitmapToWriteableBitmapFunction · 0.85
GetHIconFromFileFunction · 0.85
HIconToWriteableBitmapFunction · 0.85
dataMethod · 0.80

Tested by

no test coverage detected