我当时没有在C++制定方案,现在我不得不写一件简单的事,而是把我nut子。
I need to create a bitmap from a table of colors:
char image[200][200][3];
第一次协调是宽度、二级高度、第三色:高频。 如何这样做?
Thanks for any help. Adam
我当时没有在C++制定方案,现在我不得不写一件简单的事,而是把我nut子。
I need to create a bitmap from a table of colors:
char image[200][200][3];
第一次协调是宽度、二级高度、第三色:高频。 如何这样做?
Thanks for any help. Adam
http://en.wikipedia.org/wiki/BMP_file_format”rel=“noretinger” http://en.wikipedia.org/wiki/BMP_file_format。
有了这一手头信息,我们就能够写出一个快速的BMP:
// setup header structs bmpfile_header and bmp_dib_v3_header before this (see wiki)
// * note for a windows bitmap you want a negative height if you re starting from the top *
// * otherwise the image data is expected to go from bottom to top *
FILE * fp = fopen ("file.bmp", "wb");
fwrite(bmpfile_header, sizeof(bmpfile_header), 1, fp);
fwrite(bmp_dib_v3_header, sizeof(bmp_dib_v3_header_t), 1, fp);
for (int i = 0; i < 200; i++) {
for (int j = 0; j < 200; j++) {
fwrite(&image[j][i][2], 1, 1, fp);
fwrite(&image[j][i][1], 1, 1, fp);
fwrite(&image[j][i][0], 1, 1, fp);
}
}
fclose(fp);
如果要设立负责人,我们就知道问题。
Edit: I forgot, BMP 文档预期BGR而不是RGB,我已更新该法典(没有发现任何人)。
我建议ImageMagick,综合图书馆等。
我将首先设法查明:BMP文件格式(你用比图表示,正确吗?)是如何界定的。 然后,我将把阵列改为这种格式,并将之印制到档案中。
如果这一选择是这样,我也想设法找到一个现有的图书馆,用于编写BAMP文件,并公正使用。
如果我所说的话对你来说已经显而易见,那么我不知道你在哪一个阶段的 process。
简单图像操作 我高度建议。 这个图书馆像一个药店一样运作,非常容易使用。 你必须把标题列入你的法典。 我只字不提10分钟以汇编和测试。
但是,如果你想进行更复杂的图像操作,我将访问。 «/a>,按教学建议。
最好把这一功能作为简单的1个层面阵列。
iii (如果是每台粉碎机的数量)
char image[width * height * bytes];
然后,你可以接触以下阵列中的相关立场:
char byte1 = image[(x * 3) + (y * (width * bytes)) + 0];
char byte2 = image[(x * 3) + (y * (width * bytes)) + 1];
char byte3 = image[(x * 3) + (y * (width * bytes)) + 2];
I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...
I have been searching for sample code creating iterator for my own container, but I haven t really found a good example. I know this been asked before (Creating my own Iterators) but didn t see any ...
Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...
I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?
Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...
Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?