在Windows Style App中将sbyte转换为图像 [英] Convert sbyte to Image in Windows Style App
问题描述
我在C3中有将sbyte数组转换为图像的代码.我正在开发Windows Metro风格的应用程序,并想在Metro应用程序中使用此代码?
代码为
Hi ,
I have code in C3 which converts sbyte array to image. I am developing Windows metro style application and want to use this code in metro application?
Code is as
sbyte[][] img = byteIMG.Array;
Bitmap bmp = new Bitmap(strWidth, strHeight);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
for (int i = 0; i <= img.Length - 1; i++)
{
for (int j = 0; j <= img[i].Length - 1; j++)
{
if (img[j][i] == 0)
{
g.FillRectangle(Brushes.Black, i, j, 1, 1);
}
else
{
g.FillRectangle(Brushes.White, i, j, 1, 1);
}
}
}
bmp.Save("C:\\" + strFileName + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
但是我不能使用此ex System.Drawing.Graphics和System.Drawing.Bitmap所需的一些名称空间.
你能指导我如何做到这一点吗?
您的帮助对我非常有用....这是我项目中的迫切需求,正在进行大量搜索,但未找到任何解决方案..
请指导我
在Advance中致谢
But i cant use some of namespaces required for this ex System.Drawing.Graphics and System.Drawing.Bitmap.
Could you please guide me how can i achive this ?
your help would be greatful for me.... Its urgent need in my project and am searching a lot on but don''t found any soln ..
Please guide me
Thanks in Advance
推荐答案
对此链接进行了查看..
http://social.msdn.microsoft.com/论坛/en-US/winappswithcsharp/thread/9b74c751-72f1-4772-8f8a-da0f24468758 [
have a look on this link..
http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/9b74c751-72f1-4772-8f8a-da0f24468758[^]
这篇关于在Windows Style App中将sbyte转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!