菜鸟教程小白 发表于 2022-12-13 07:44:49

android - 使用 Titanium 保存我的手势


                                            <p><p>我正在使用 <strong>Titanium appcelerator</strong> 开发 <strong>android</strong> 和 <strong>ios</strong> 应用程序,现在我需要 <strong>绘图或绘画</strong>我的 Activity 并希望<strong>将其保存为图片</strong>。</p>

<p>-我找到了这个模块<a href="https://github.com/appcelerator/titanium_modules/tree/master/paint/mobile/android" rel="noreferrer noopener nofollow"><strong><em>Ti.paint module link</em></strong></a> </p>

<ul>
<li>上面的模块效果很好,我可以用这个来画画,但是我<strong>不能</strong>能够<strong>保存</strong>我的<strong>手势</strong><</li>
</ul>

<p>我一直在寻找,但找不到保存我的画的方法..</p>

<p>哪位大神能指教一下...</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>我得到了答案,保存我的手势画..</p>

<p>代码是:</p>

<pre><code>var filename = &#34;savedPainting1.jpg&#34;;
var sigImg = paintView.toImage().media;
var img = Titanium.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory, filename);
img.write(sigImg);
</code></pre></p>
                                   
                                                <p style="font-size: 20px;">关于android - 使用 Titanium 保存我的手势,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/23648331/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/23648331/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: android - 使用 Titanium 保存我的手势