Comments (7)
Int32是4字节,TAlphaColor也是4字节
不会溢出。
你有崩溃的例子嘛?
from fmxui.
UI.Utils.pas中的HtmlColorToColor方法中,如果颜色指定为color=''#303030''或color=''303030''时,会分别调用到调用下面两行语句
第878行Result := StrToIntDef('$ff' + Copy(S, 2, Length(S) - 1), 0)
第903行if (Length(s) = 6) then result := StrToIntDef('$ff' + s, 0)
StrToIntDef方法会将$ff303030转为-13619152,而返回值TAlphaColor的类型是type Cardinal,数字越界导致的程序崩溃
建议这两个方法将'$ff'改成'$',或者用StrToUIntDef
from fmxui.
另外这个错误只有在动态赋值的时候才会出现,设计期直接指定的话运行没问题
from fmxui.
ShowMessage(IntToHex(HtmlColorToColor('#303030')));
未测试到崩溃,最终的数值也不错。
不过确实是用StrToUIntDef好些,已更新。
感谢反馈
from fmxui.
是我的错,程序崩溃是因为在FormCreate中
,属于Application.Error,让我误以为是崩溃,在ButtonView1Click中只是Error,所以只是弹出错误框,我之前都是在窗体显示前修改的HtmlText,没有测试窗体显示后修改HtmlText,所以才说崩溃
from fmxui.
这就奇怪了。我也经常这样赋值,没遇到过错误
from fmxui.
那就不清楚了,要不就是delphi版本的问题,要不就是编译开关的问题,我这边是xe11,编译开关没改过
from fmxui.
Related Issues (20)
- ListViewEx + KeyEvents HOT 1
- ListViewEx + Headers/Sections + Index HOT 2
- ListViewEx + FastScroll HOT 1
- ListViewEx + ItemHovered
- 应用沉浸式标题栏时,点击页面抖动问题 HOT 6
- SVG? HOT 2
- Is FMXUi "Active" HOT 2
- Crash app IOS in TTextView -> SVGimage.Parse() HOT 4
- 在使用多选列表适配器时,单击item时会触发两次ItemClick HOT 3
- TDialogBuilder -> SetItems -> FontSize Items HOT 3
- TEditView -> ControlType = Plataform ? HOT 2
- TListViewEx + FontSize HOT 1
- In Delphi 11.3 Animations no longer work in [TFrameAniType] HOT 6
- Set ImageIndex to ItemDefault on TEditView HOT 1
- TViewHtmlText当有两个超链接的时候,第二个超链接的点击似乎收不到 HOT 1
- TVertScrollView -> UI.ListView.Header [position of loading] HOT 8
- Memory Leak On TToastManager In Delphi 11.3.1 HOT 7
- TEditView HOT 1
- liearlaoyut HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmxui.