-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Textbox 有内容时,CPU会高 #3
Comments
是,那些函数没有,AppendText的话可以有别的函数,我忘记是不是GetLines里面的了,你找找。 -----Original Message----- 我利用gaclib写了一个剪贴板的查看工具https://github.com/isee15/Clipboard-Viewer。界面里面有一些TextBox。 Reply to this email directly or view it on GitHub: |
void WindowsInputService::StartTimer() gac的窗口每隔16ms就重绘一次,也会导致cpu较高, |
@yinkaisheng 这是故意的。因为如果你窗口内容改变才重绘的话,我就要不断的去监视所有view model更新的事件,而且layout算法复杂度直接平方,到时候会直接卡。我宁可把cpu平均的用下来。 |
@yinkaisheng 不过关于timer的事情,chemical elements的cpu高是因为绘图的过程太复杂。如果上面什么都没有的话,就算timer一毫秒一次,cpu也几乎是0。 |
我利用gaclib写了一个剪贴板的查看工具https://github.com/isee15/Clipboard-Viewer。界面里面有一些TextBox。
当TextBox里面有类似下面这些内容的时候,CPU容易达到17-25(CPU是双核)。
ps:使用过程中,有些接口没找到怎么实现。比如程序图标设置的接口,WString的Format,TextBox的AppendText
“00000000 7B 5C 72 74 66 5C 61 6E {\rtf\an
00000008 73 69 7B 5C 66 6F 6E 74 si{\font
00000010 74 62 6C 7B 5C 66 30 20 tbl{\f0
00000018 4E 53 69 6D 53 75 6E 3B NSimSun;
00000020 7D 7D 7B 5C 63 6F 6C 6F }}{\colo
00000028 72 74 62 6C 3B 5C 72 65 rtbl;\re
00000030 64 33 33 5C 67 72 65 65 d33\gree
00000038 6E 31 31 31 5C 62 6C 75 n111\blu
00000040 65 31 33 33 3B 5C 72 65 e133;\re
00000048 64 32 35 35 5C 67 72 65 d255\gre
00000050 65 6E 32 35 35 5C 62 6C en255\bl
00000058 75 65 32 35 35 3B 5C 72 ue255;\r
00000060 65 64 30 5C 67 72 65 65 ed0\gree
00000068 6E 30 5C 62 6C 75 65 30 n0\blue0
00000070 3B 5C 72 65 64 30 5C 67 ;\red0\g
00000078 72 65 65 6E 30 5C 62 6C reen0\bl
00000080 75 65 31 32 38 3B 5C 72 ue128;\r
00000088 65 64 30 5C 67 72 65 65 ed0\gree
00000090 6E 30 5C 62 6C 75 65 32 n0\blue2
00000098 35 35 3B 5C 72 65 64 31 55;\red1
000000A0 33 36 5C 67 72 65 65 6E 36\green
000000A8 30 5C 62 6C 75 65 30 3B 0\blue0;
000000B0 7D 5C 66 30 20 5C 66 73 }\f0 \fs
000000B8 31 39 20 5C 63 66 31 20 19 \cf1
000000C0 5C 63 62 32 20 5C 68 69 \cb2 \hi
000000C8 67 68 6C 69 67 68 74 32 ghlight2
000000D0 20 47 75 69 43 65 6C 6C GuiCell
000000D8 43 6F 6D 70 6F 73 69 74 Composit
000000E0 69 6F 6E 5C 63 66 33 20 ion\cf3
000000E8 2A 20 5C 63 66 34 20 63 * \cf4 c
000000F0 65 6C 6C 5C 63 66 33 20 ell\cf3
000000F8 20 3D 20 5C 63 66 35 20 = \cf5
00000100 6E 65 77 5C 63 66 33 20 new\cf3
00000108 20 5C 63 66 31 20 47 75 \cf1 Gu
00000110 69 43 65 6C 6C 43 6F 6D iCellCom
00000118 70 6F 73 69 74 69 6F 6E position
00000120 5C 63 66 33 20 3B 5C 70 \cf3 ;\p
00000128 61 72 20 09 09 09 5C 63 ar उ찀쳌쳌쳌쳌绤̝᳸킰װ尉찀쳌쳌쳌쳌绤̝᳸킰װc
00000130 66 34 20 72 6F 77 32 74 f4 row2t
00000138 61 62 6C 65 5C 63 66 33 able\cf3
00000140 20 2D 3E 5C 63 66 36 20 ->\cf6
00000148 41 64 64 43 68 69 6C 64 AddChild
00000150 5C 63 66 33 20 28 5C 63 \cf3 (\c
00000158 66 34 20 63 65 6C 6C 5C f4 cell
00000160 63 66 33 20 29 3B 5C 70 cf3 );\p
00000168 61 72 20 09 09 09 5C 63 ar उ찀쳌쳌쳌쳌绤̝᳸ꉨ״尉찀쳌쳌쳌쳌绤̝᳸ꉨ״c
00000170 66 34 20 63 65 6C 6C 5C f4 cell
00000178 63 66 33 20 2D 3E 5C 63 cf3 ->\c
00000180 66 36 20 53 65 74 53 69 f6 SetSi
00000188 74 65 5C 63 66 33 20 28 te\cf3 (
00000190 30 2C 20 30 2C 20 31 2C 0, 0, 1,
00000198 20 31 29 3B 5C 70 61 72 1);\par
000001A0 20 09 09 09 5C 63 66 34 उ찀쳌쳌쳌쳌绤̝䜈킰װ尉찀쳌쳌쳌쳌绤̝䜈킰װcf4
000001A8 20 63 65 6C 6C 5C 63 66 cell\cf
000001B0 33 20 2D 3E 5C 63 66 36 3 ->\cf6
000001B8 20 41 64 64 43 68 69 6C AddChil
000001C0 64 5C 63 66 33 20 28 5C d\cf3 (
000001C8 63 66 34 20 64 61 74 61 cf4 data
000001D0 46 6F 72 6D 61 74 54 65 FormatTe
000001D8 78 74 5C 63 66 33 20 2D xt\cf3 -
000001E0 3E 5C 63 66 36 20 47 65 >\cf6 Ge
000001E8 74 42 6F 75 6E 64 73 43 tBoundsC
000001F0 6F 6D 70 6F 73 69 74 69 ompositi
000001F8 6F 6E 5C 63 66 33 20 28 on\cf3 (
00000200 29 29 3B 7D 00 ));}.
”
The text was updated successfully, but these errors were encountered: