Smobiler上海石磨_.NET移动开发平台

标题: 如何截取手机图片并保存? [打印本页]

作者: wakiong    时间: 2020-3-29 00:18
标题: 如何截取手机图片并保存?
想实现手机屏幕截图功能,但没找到Smobile的相关文档,于是借鉴了C#的截图代码。
代码如下:            Bitmap bit = new Bitmap(this.Width, this.Height);       //实例化一个和图像控件一样大的bitmap
            Graphics g = Graphics.FromImage(bit);
            g.CompositingQuality = CompositingQuality.HighQuality;     //质量设为最高
            g.CopyFromScreen(this.Left, this.Top, 0, 0, new Size(this.Width, this.Height));      //保存整个控件为图片
            bit.Save(MobileResourceManager.DefaultImagePath + "\\TempFile\\" + "a.png");  

运行结果见附图。
问题:最终保存的图片是截取了服务器上的屏幕图片,这不是我想要的,我是想截取手机客户端的图片,请问以上代码问题出在哪里,这个功能该如何实现?感谢!


作者: Lula.Jin    时间: 2020-5-27 11:00
可以试试使用codecompiler实现 https://www.smobiler.com/guide/CodeCompiler.aspx




欢迎光临 Smobiler上海石磨_.NET移动开发平台 (https://www.smobiler.com/) Powered by Discuz! X3.2