PIXNET Logo登入

小賢的部落格

跳到主文

取之於網路、饋之於網路 ; 邊做邊學、用以致學
☕️ 請作者喝一杯咖啡

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 2月 13 週一 201702:18
  • [UWP] ValueTypes可能性測試


結論:
1.Compiled Binding (x:Bind) 只支援Mode = OneTime,其它像OneWay、TwoWay 會 Compile error。
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(8)

  • 個人分類:UWP
▲top
  • 2月 11 週六 201717:44
  • [UWP] 在App進入背景或進入前景時,觸發OnNavigatedTo, OnNavigatedFrom

[UWP] 在進入背景或進入前景時,觸發OnNavigatedTo, OnNavigatedFrom。
  每個Page都會有自己的進入頁面跟離開頁面的邏輯,有時會希望App進入背景 or 進入前景時也能夠呼叫到目前頁面的 OnNavigatedTo, OnNavigatedFrom,但預設是不會被呼叫的,
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(515)

  • 個人分類:UWP
▲top
  • 11月 26 週六 201620:17
  • [UWP] 取得IMEI

Package.appxmanifest:
<Package xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(105)

  • 個人分類:UWP
▲top
  • 11月 16 週三 201617:09
  • [UWP] Save BitmapImage

參考資料:
https://www.youtube.com/watch?v=vuGSkrx8fuo
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(42)

  • 個人分類:UWP
▲top
  • 10月 09 週日 201601:35
  • [UWP] DES加解密

 
private const string strKey = "Key";
private const string strIV = "IV";
public static string Encrypt(string message)
{
if (string.IsNullOrEmpty(message))
{
return string.Empty;
}
var keyBuffer = CryptographicBuffer.ConvertStringToBinary(strKey, BinaryStringEncoding.Utf8);
var ivBuffer = CryptographicBuffer.ConvertStringToBinary(strIV, BinaryStringEncoding.Utf8);
var messageBuffer = CryptographicBuffer.ConvertStringToBinary(message, BinaryStringEncoding.Utf8);
var provider = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.DesCbcPkcs7);
var key = provider.CreateSymmetricKey(keyBuffer);
var buffEncrypt = CryptographicEngine.Encrypt(key, messageBuffer, ivBuffer);
return CryptographicBuffer.EncodeToBase64String(buffEncrypt);
}
public static string Decrypt(string encryptedBase64String)
{
if (string.IsNullOrEmpty(encryptedBase64String))
{
return string.Empty;
}
var buffer = CryptographicBuffer.ConvertStringToBinary(strKey, BinaryStringEncoding.Utf8);
var ivBuffer = CryptographicBuffer.ConvertStringToBinary(strIV, BinaryStringEncoding.Utf8);
var provider = SymmetricKeyAlgorithmProvider.OpenAlgorithm(SymmetricAlgorithmNames.DesCbcPkcs7);
var keyBuffer = provider.CreateSymmetricKey(buffer);
var decryptedBuffer = CryptographicEngine.Decrypt(keyBuffer, CryptographicBuffer.DecodeFromBase64String(encryptedBase64String), ivBuffer);
return CryptographicBuffer.ConvertBinaryToString(BinaryStringEncoding.Utf8, decryptedBuffer);
}
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(19)

  • 個人分類:UWP
▲top
  • 9月 29 週四 201600:26
  • [UWP] Win10 Mobile 相機Preview旋轉問題

 
public partial class TakePhotoPage
{
private MediaCapture _mediaCapture;
private bool _isPreviewing;
private DisplayRequest _displayRequest;
private async Task StartPreviewAsync()
{
try
{
_mediaCapture = new MediaCapture();
await _mediaCapture.InitializeAsync();
PreviewControl.Source = _mediaCapture;
await _mediaCapture.StartPreviewAsync();
_isPreviewing = true;
_displayRequest = new DisplayRequest();
_displayRequest.RequestActive();
DisplayInformation.AutoRotationPreferences = DisplayOrientations.PortraitFlipped;
// 解決手機上的旋轉問題
SimpleOrientationSensor sensor = SimpleOrientationSensor.GetDefault();
if (sensor == null)
{
return;
}
sensor.OrientationChanged += (s, arg) =>
{
switch (arg.Orientation)
{
case SimpleOrientation.Rotated90DegreesCounterclockwise:
_mediaCapture.SetPreviewRotation(VideoRotation.None);
break;
case SimpleOrientation.Rotated180DegreesCounterclockwise:
case SimpleOrientation.Rotated270DegreesCounterclockwise:
_mediaCapture.SetPreviewRotation(VideoRotation.Clockwise180Degrees);
break;
default:
_mediaCapture.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
break;
}
};
}
catch (UnauthorizedAccessException)
{
// This will be thrown if the user denied access to the camera in privacy settings
var messageDialog = new MessageDialog("The app was denied access to the camera");
await messageDialog.ShowAsync();
}
catch (Exception ex)
{
var messageDialog = new MessageDialog("MediaCapture initialization failed. {0}", ex.Message);
await messageDialog.ShowAsync();
}
}
private async Task CleanupCameraAsync()
{
if (_mediaCapture == null)
{
return;
}
if (_isPreviewing)
{
await _mediaCapture.StopPreviewAsync();
}
await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
PreviewControl.Source = null;
if (_displayRequest == null)
{
return;
}
_displayRequest.RequestRelease();
});
_mediaCapture.Dispose();
_mediaCapture = null;
}
}
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(51)

  • 個人分類:UWP
▲top
  • 6月 12 週日 201616:17
  • [UWP] Back Button

1.在OnNavigateTo 裡,設定是否顯示Back Button
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(18)

  • 個人分類:UWP
▲top
  • 6月 11 週六 201601:49
  • [UWP] GridView item with adaptive trigger


假如想根據不同螢幕寬度來變更GridViewItem的大小,可用Adaptive Trigger 搭配Multi Style 的方式
(UI畫面)
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(47)

  • 個人分類:UWP
▲top
  • 10月 23 週五 201518:48
  • [UWP] Win10M 10572 無法部署App

Question

※ 不建議升級Win10 Mobile 10572 及Windows insider preview sdk,如果你要submit app 到Windows store 的話...
Win10 Mobile Device:
1.先將語言調成英文版
2.settings ->system->storage->New apps will save to : SD Card
Windows 10 Desktop:
1.安裝 Windows Insider Preview SDK ( 目前最新是 build 10563) 
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(98)

  • 個人分類:UWP
▲top
  • 10月 13 週二 201500:14
  • [UWP] DataTrigger


客製化StateTriggerBase ,實現類似WinRT 8.1 的Behavior SDK DataTrigger
(繼續閱讀...)
文章標籤

小賢 發表在 痞客邦 留言(0) 人氣(57)

  • 個人分類:UWP
▲top
12»

文章搜尋

文章分類

  • AI (4)
  • iOS (243)
  • Android (16)
  • Flutter (1)
  • .NET MAUI (Xamarin) (18)
  • UWP (18)
  • Windows Universal App 8.1 (9)
  • Windows Store 8.0 App (8)
  • Windows Phone 7, 8.0/XNA (17)
  • Windows Mobile 6 (2)
  • Silverlight (1)
  • WPF (6)
  • CUDA (1)
  • C# (20)
  • C/C++ (1)
  • VB6 (2)
  • HTML 5 (2)
  • ASP.NET MVC (5)
  • Blender (11)
  • 硬體 (1)
  • 軟體 (2)
  • 心情生活 (19)
  • 超好聽的音樂 (15)
  • 當兵的甘苦談 (2)
  • 未分類文章 (1)

最新文章

  • [Flutter] 學習資源
  • [Swift] Swift 6.2 改善開發者體驗
  • [iOS] 使用Github action包版
  • [iOS] 切換git branch自動pod install
  • [Xcode cloud] CI script 由 ChatGPT產生
  • [n8n] Docker n8n 使用本地whisper指令
  • [AI] 本地語音轉文字
  • [n8n] Docker 安裝n8n
  • [iOS] AI Assist 方案研究參考資料
  • [Xcode cloud] Github (private) repo找不到branch

熱門文章

  • (5,527)[C#] RGB、HSI色彩空間互轉要注意的地方
  • (5,426)[Android] 漸層色背景
  • (4,922)怒!! TQC真的太誇張
  • (2,856)[iOS] Mac下的檔案差異比對工具 - FileMerge
  • (1,994)[iOS] 取得App Store 的網址
  • (1,614)超好聽的音樂4(紀曉君-神話(Luxgen 汽車廣告歌曲)原住民歌曲)
  • (1,279)我的TQC後續發展...
  • (398)[Swift] FB SDK 4.11 實作程式碼
  • (303)[Swift] Photo Framework
  • (263)[Blender] 水球練習

最新留言

  • [22/04/11] 訪客 於文章「Windows Vista, 7, 8以...」留言:
    原本在搜尋引擎找出一堆 Blog 文章,不知哪幾篇值得花時間...
  • [16/05/12] pop 於文章「[C#] WPF的高速影像處理...」留言:
    您好: 測試用Source Code下載的下載連結,似乎已...
  • [15/11/25] ** 於文章「解決 Visual Studio C# ...」留言:
    你好,我在使用visual studio 2015 VB中,...
  • [15/05/27] 訪客 於文章「[C#] RGB、HSI色彩空間互轉要注...」留言:
    你好 請問RGB 轉到 HSI 在轉回RGB後 每...
  • [15/05/19] GG 於文章「[Win7] 解決無法釘選(pin) 到...」留言:
    讚喔,感恩。...
  • [14/12/12] 花翔 於文章「使用WebClient 請求Http G...」發表了一則私密留言
  • [14/11/24] 唐依蕾 於文章「[C] 使用C語言重現Chrome 30...」留言:
    你好,我想請問這個廣告的背景樂和出處,你曉得嗎?...
  • [14/11/20] hoppy 於文章「在 EeePC 901 上裝 Windo...」留言:
    請問該如何安裝呢? 可否分享一下?...
  • [14/11/06] 花翔 於文章「開啟這學期的讀書之路!!...」發表了一則私密留言
  • [14/01/13] ann41129 於文章「[C#] 關於亂數產生的範圍...」發表了一則私密留言

參觀人氣

  • 本日人氣:
  • 累積人氣:

贊助作者