在Pocket PC中平移和缩放图像 [英] Panning and zooming image in Pocket PC

查看:121
本文介绍了在Pocket PC中平移和缩放图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!
我想编写一个用于在掌上电脑上查看图像的项目.我尝试使用Google搜索,但我知道.Net CF不支持GDI +.有一些有关在Net Framework上进行平移和缩放的项目,但它仅适用于GDI +.我尝试使用下面的代码来调整图像的大小:

Hi all!
I want to write a project for viewing image on pocket pc. I try to googling, and I knew that .Net CF didn''t support GDI+. There are some project about panning and zooming on Net Framework but it only worked on GDI+. I tried to use code bellow to resize image:

public static Image Resize(Image image, Size size)
{
    Image bmp = new Bitmap(size.Width, size.Height);
    using (var g = Graphics.FromImage(bmp))
    {
        g.DrawImage(
            image,
            new Rectangle(0, 0, size.Width, size.Height),
            new Rectangle(0, 0, image.Width, image.Height),
            GraphicsUnit.Pixel);
    }
    return bmp;
}


我遇到了一些问题.对于800x600或1024x768的图像,它的工作速度非常慢,并且将异常抛出内存.关于平移,我看到此链接 http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5823e285-6999-40f5-b28a-74480a0acb13 但mouse.Location似乎没有出现在Net CF中.
此链接 http://www.codeproject.com/KB/graphics/PanZoom2.aspx?msg=3876775#xx3876775xx 非常令人兴奋,但不适用于.Net CF .
有什么建议吗?
非常感谢您..Phewww


I had some problems with them. With image 800x600 or 1024x768, it worked very slowly and threw exception out of memory. About panning, I see this link http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/5823e285-6999-40f5-b28a-74480a0acb13 but mouse.Location seems not appear in Net CF.
This link http://www.codeproject.com/KB/graphics/PanZoom2.aspx?msg=3876775#xx3876775xx is very excited but it didn''t work on .Net CF.
Any suggestion for me?
Thank you very much..Phewww

推荐答案

我不知道这是否对解决此特定问题有所帮助,但您可能想看一下OpenNETCF.
祝你好运!
i don''t know if it will help for this particular problem, but you might want to take a look at OpenNETCF.
good luck!


这篇关于在Pocket PC中平移和缩放图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆