From 61deef5cdf96cbfdd6ad45be49e80d597c00ca65 Mon Sep 17 00:00:00 2001 From: QuakeGod <QuakeGod@sina.com> Date: 星期二, 24 十二月 2024 08:37:21 +0800 Subject: [PATCH] 2024-12-24 --- LCDDisplay/LCDDisplayTestDlg.cpp | 46 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 45 insertions(+), 1 deletions(-) diff --git a/LCDDisplay/LCDDisplayTestDlg.cpp b/LCDDisplay/LCDDisplayTestDlg.cpp index 3116b4b..a94d5be 100644 --- a/LCDDisplay/LCDDisplayTestDlg.cpp +++ b/LCDDisplay/LCDDisplayTestDlg.cpp @@ -170,7 +170,10 @@ return static_cast<HCURSOR>(m_hIcon); } - +void CLCDDisplayTestDlg::DbgLog(CString s1) +{ + ((CEdit*)GetDlgItem(IDC_EDIT_LOG))->ReplaceSel(s1); +} void CLCDDisplayTestDlg::OnBnClickedButton1() { @@ -307,6 +310,47 @@ } m_lcd_display.RedrawWindow(); + + CString s1; + CString s2; + unsigned char pixels[8][8] = { 0 }; + + for (int ch = 0; ch < 128; ch++) + { + long long dots = font5_7[ch]; + s1.Format(_T("{")); + for (int m = 0; m < 7; m++) { + int line = dots & 0x3f; + int mask = 1; + for (int n = 0; n < 5; n++) + { + if (line & mask) + { + pixels[m][n] = 1; + } else pixels[m][n] = 0; + mask <<= 1; + } + dots >>= 6; + } + + for (int m = 0; m < 5; m++) { + int line = 0; + int mask = 1; + for (int n = 0; n < 7; n++) + { + if (pixels[n][m]) + { + line |= mask; + } + mask <<= 1; + } + s2.Format(_T("0x%02X"), line); + s1 += s2 ; + if (m < 4) { s1 += _T(","); } + } + s1.AppendFormat(_T("}, // %c \r\n"),ch); + DbgLog(s1); + } } -- Gitblit v1.9.1