0
我正在開發一個在線工具,編輯圖像,但我有一個問題。在複製特定區域的位圖到另一個位圖。有什麼問題,任何人都可以幫我解決問題嗎?複製特定區域使用copypixels()在動作腳本
function enablepaste(event:MouseEvent)
{
tempShape.graphics.clear();
mv_temp.graphics.clear();
var rect = new Rectangle(tempstartX,tempstartY,endX,endY);
var pnt =new Point(tempstartX,tempstartY);
tempBMP_data=new BitmapData(rect.width,rect.height,false,0);
tempBMP_data.copyPixels(stageBMP.bitmapData,rect,pnt , null, null, true);
//tempBMP_data is destinagtion bitmap data object
tempBMP= new Bitmap(tempBMP_data);
mv_temp.addChild(tempBMP);
Paste_button.visible=true;
}
,我面臨的問題是,它顯示了沒有複製圖形只有矩形。
感謝的答案,但與克隆整個位圖將被複制,我想用戶 – Manthan 2012-07-13 07:33:19
哦選擇的特定區域,克隆整個位圖不是我的建議的解決方案,我只是說,你可以用它來確認stageBMP正確生成。因爲如果stageBMP爲空或黑色出於某種原因,你會得到的結果作爲您在您的問題描述。 – 2012-07-13 07:39:04
沒有..圖像已經被加載到stageBMP,並與其他功能的正常工作,但只複製和粘貼不工作是否有任何其他方法我可以使用???? – Manthan 2012-07-13 07:46:57