Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net Delphi中字节到指针的列表_.net_Delphi_Pointers - Fatal编程技术网

.net Delphi中字节到指针的列表

.net Delphi中字节到指针的列表,.net,delphi,pointers,.net,Delphi,Pointers,我有这个例子在vb.net我需要在Delphi相同的输出。它基本上是一个指针列表,每个指针应该指向一个字节数组(一个图像) 我尝试了许多不同的方法来转换它,但似乎都不起作用 我不确定什么是ImageList。它似乎不是该名称的WinForms控件。假设您知道如何执行Marshal.Copy部分,那么您需要这样的操作: var PointerArray: array of Pointer; ..... SetLength(PointerArray, ImageList.Count); for

我有这个例子在vb.net我需要在Delphi相同的输出。它基本上是一个指针列表,每个指针应该指向一个字节数组(一个图像)


我尝试了许多不同的方法来转换它,但似乎都不起作用

我不确定什么是
ImageList
。它似乎不是该名称的WinForms控件。假设您知道如何执行
Marshal.Copy
部分,那么您需要这样的操作:

var
  PointerArray: array of Pointer;
.....
SetLength(PointerArray, ImageList.Count);
for i := 0 to ImageList.Count-1 do
begin
  PointerArray[i] := GetMem(ImageList[i].Size);
  // copy contents of i-th image to PointerArray[i]
end;

PointerArray[i]:=GetMem(ImageList[i].Size);给了我“无效类型”@Ezi好吧,我猜什么是
ImageList[I]
。我完全不知道。你没告诉我们。您询问了如何创建指针数组。如果你想提供更多细节,那么我可以提供更多帮助。这是非常基本的东西,但你真的需要学习如何理解自己的编译器错误。我想,
Size
是图像的像素尺寸。无论如何,请将上面的代码作为大纲查看。具体细节由你来填写,很抱歉我没有告诉你。ImageList是一个包含记录列表的TStream,每条记录都有一个“字节数组”,好吧,但我的建议是正确的。你一定能从这里解决,对吗?
var
  PointerArray: array of Pointer;
.....
SetLength(PointerArray, ImageList.Count);
for i := 0 to ImageList.Count-1 do
begin
  PointerArray[i] := GetMem(ImageList[i].Size);
  // copy contents of i-th image to PointerArray[i]
end;