如何声明一个Bitmap类型的数组 [英] How to declare an array of Bitmap type
本文介绍了如何声明一个Bitmap类型的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好
我的问题是我想用C ++表单声明一个System :: Drawing :: Bitmap数组,我可以在c#中声明它虽然。在c#中你这样做
System.Drawing.Bitmap [] bmpArray = new System.Drawing.Bitmap [ 10000 ];
当我尝试用C ++做的事情
System :: Drawing :: Bitmap ^ bmpArray [];
它说
错误 1 :本机数组不能包含此托管类型
请直接指导我
Ps我是初学者所以忽略我的愚蠢
解决方案
我不经常用C ++编码,但我认为这是正确的...
数组< Bitmap ^> ^ bmpArray = gcnew数组< Bitmap ^>(10000);
<集团kquote> array< bitmap ^> ^ ab = gcnew array< bitmap ^>(100);
Hello
My question is i want to declare an array of System::Drawing::Bitmap in C++ forms i i can declare it in c# although.In c# you do this
System.Drawing.Bitmap[] bmpArray = new System.Drawing.Bitmap[10000];
when i try to do it in C++
System::Drawing::Bitmap^ bmpArray[] ;
it says
"
Error 1 : a native array cannot contain this managed type
"
kindly direct me
P.s i am a beginner so ignore my dumbness
解决方案
I don''t code in C++ often but I think this is correct...
array<Bitmap^>^ bmpArray = gcnew array<Bitmap^>(10000);
array<bitmap^>^ ab = gcnew array<bitmap^>(100);
这篇关于如何声明一个Bitmap类型的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文