tmapaccess.mareadwrite未使用delphi 11定义
下面的代码片段适用于Delphi 10.4和FMX框架,但不使用Delphi 11进行编译。错误:MareadWrite未定义
[dcc64 Error] ImageUnit.FMX.pas(5340): E2003 Undeclared identifier: 'maReadWrite'
如何解决此问题以及如何使用Delphi 10.4和Delphi 11编写代码?
var bit : TBitmap;
begin
if (Bit.Map(TMapAccess.maReadWrite, bitdata1)) then
try
for i := 0 to Bit.width - 1 do
for j := 0 to Bit.height - 1 do
begin
the code fragment below works fine for DELPHI 10.4 and FMX framework, but does not compile using DELPHI 11 . Error : maReadWrite not defined
[dcc64 Error] ImageUnit.FMX.pas(5340): E2003 Undeclared identifier: 'maReadWrite'
How to solve this issue and how to write code which compiles using DELPHI 10.4 and DELPHI 11 ?
var bit : TBitmap;
begin
if (Bit.Map(TMapAccess.maReadWrite, bitdata1)) then
try
for i := 0 to Bit.width - 1 do
for j := 0 to Bit.height - 1 do
begin
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
以
ma
前缀开头的TMAPACCESS
值 deprecected 10.4 10.4删除前缀(IE) Maread
- > mawrite - > > readwrite )。您应该在10.4中就此发出编译器警告。最终在11.0亚历山大的情况下完全删除了前缀的值。
因此,为这两个版本编写此代码的正确方法是简单地使用较新的非预装值名称,例如:
The
TMapAccess
values that begin with thema
prefix were deprecated before 10.4 to drop the prefix (iemaRead
->Read
,maWrite
->Write
,maReadWrite
->ReadWrite
). You should have gotten compiler warnings about this in 10.4.The prefixed values were finally removed completely in 11.0 Alexandria.
So, the correct way to write this code for both versions is to simply use the newer non-prefixed value names, eg: