【问题标题】:transparent erase in iOS- TitaniumiOS - Titanium中的透明擦除
【发布时间】:2013-07-09 13:53:46
【问题描述】:

我在上面有两张图像,我想从顶部图像中删除一小部分以显示背景图像。是否可以在 iOS 上使用钛进行透明擦除?

感谢和问候, 甘尼什 M

【问题讨论】:

    标签: ios titanium paint titanium-mobile appcelerator-mobile


    【解决方案1】:

    您可以使用ti.paint module 执行此操作。具体来说,它能够在画布上拥有可以擦除的图像。安装后,试试这个:

    // Container window
    var win = Ti.UI.createWindow({ backgroundColor: '#fff' });
    // Background image
    var backgroundImage = Ti.UI.createImageView({
        image : 'yourbgimage.png'
        width : Ti.UI.FILL,
        height : Ti.UI.FILL
    });
    
    // Require paint module and add to view with an erasable image
    var Paint = require('ti.paint');
    var paintView = Paint.createPaintView({
        image : 'yourfgimage.png', // This is the image you erase
        eraseMode : true,
        width : Ti.UI.FILL,
        height : Ti.UI.FILL,
        strokeColor : '#0f0', strokeAlpha : 255, strokeWidth : 10
    });
    
    win.add(backgroundImage);
    win.add(paintView);
    win.open();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多