How to combine two bitmapData with blendMode?

I will simplify my case with an example:

Set 2 clips on the stage, each with a rectangle in it that have different colors. Put one on the other and apply upwards a certain blending mode that shows a visual difference. OK so what I have to do now is to capture the bitmapData both and it redraw in a single MovieClip, so what I need is to merge the bitmapData 2, which has worked well without a blendMode, but I can't make it work just with blendMode, can anyone help?

Here is the code I have so far (he located on the 1 frame of the main timeline):

import flash.display.Sprite;
import flash.display.BitmapData;
import flash.geom.Point;
import flash.display.MovieClip;
function makeTrans(targetArr:Array, container:*):void
{
 var targetBitmapDataArr:Array = [];
 var maxBitmapDataWidth:Number = 0;
 var maxBitmapDataHeight:Number = 0;
 for(var i:Number = 0; i < targetArr.length; i++){
  var target:* = targetArr[i];
  var myRectangle:Rectangle = new Rectangle(0,0,target.width,target.height);
  var myMatrix:Matrix = new Matrix();
  var myBitmapData:BitmapData = new BitmapData(target.width,target.height,true,0xFFFFFFFF);
  myBitmapData.draw(target,myMatrix,null,target.blendMode,myRectangle,false);
  targetBitmapDataArr.push(myBitmapData);
  maxBitmapDataWidth = Math.max(maxBitmapDataWidth,target.width);
  maxBitmapDataHeight = Math.max(maxBitmapDataHeight,target.height);
 }
 var finalBitmapData:BitmapData = new BitmapData(maxBitmapDataWidth,maxBitmapDataHeight,true,0xFFFFFFFF);
 var startPoint:Point = new Point(0,0);
 var mult:uint = 0x100;
 for (var j:Number = 0; j < targetBitmapDataArr.length; j++){
  finalBitmapData.merge(targetBitmapDataArr[j],targetBitmapDataArr[j].rect,startPoint,mult,mult,mult,mult);
 }
 container.graphics.clear();
 container.graphics.beginBitmapFill(finalBitmapData,null,false,false);
 container.graphics.drawRect(0,0,finalBitmapData.width,finalBitmapData.height);
 container.graphics.endFill();
}
var transition:Sprite = new Sprite();
addChild(transition);
makeTrans([mc1,mc2],transition);

If the two MovieClips are normal blendMode, it works very well, blendMode setting does not have the desired result, test and please let me know how to do this correctly. I do this for purposes of optimization, because in my real case, I have an entire Web site, I want to apply the mix mode affecting the performance of the current animations much and given that the blend mode is applied mainly background + a few decorations more on this, I think it would probably eliminate the need for permanent blendMode being all the time and just to get the result final background and then I can show only that and hide/disable everything else.

Thanks in advance!

Can you give an example more short which doesn't work as expected? I just did a little test with some bitmap icons - put the two on stage - one above the other the value mode of inverses of mixture, then a new bitmap of them... worked perfect. Here's the code I used:

var c:BitmapData = new BitmapData (32.37);
c.Draw (a);
c.Draw (b, NULL, NULL, b.blendMode);

var f: Bitmap = new Bitmap (c);
addChild (f);

First icon has an instance name, second is b... The new bitmap is exactly the same as the two on stage.

Tags: Adobe Animate

Similar Questions

  • How to combine two video projects in Windows Movie Maker?

    How to combine two projects?

    I started a project and I would like to import and more old project to combine.

    I guess that you are referring to the project .mswmm files?

    The following steps may be worth a try:

    Reach... File / open project... Select a project file.
    When the project appears on the timeline... go to...
    Edition / select all.

    Open a different project... to... Editing / paste.

    Now the content of the two projects should be on
    the chronology.

    To add more doing the same thing...

    Edition / select all... open a project... Editing / paste

    Another method would be to publish (save) each
    the project in film WMV format and then re-import
    both WMV clips and slide both to the
    timeline. Then, you could publish it as a simple video.

  • How to bridge two computers with their own operating system, Server1 to Server2 in the same room.

    Original title: bridge two segents HOW?

    Seem like MS does not explain how to fill two computers with their own operating system-> beautiful graphics and he said it's possible-> we know how to add segments to the bridge after its creation?  Server1 to Server2 in the same room.

    This issue is beyond the scope of this site and must be placed on Technet or MSDN

    http://social.msdn.Microsoft.com/forums/en-us/home

  • can anyone tell how to compare two documents with two controlled with the same mouse pointers

    can anyone tell how to compare two documents with two controlled with the same mouse pointers?

    Windows and OS X can only display a mouse pointer - it is created by the operating system, not the application.

  • How to combine two annexes to function as one in a single file

    I don't know how to combine two calendars in a single file. I want to eliminate the process of selection of the two annexes and pulling them upward at the same time. They need to exist as a single file. I do this using the export and import function? Copy paste perhaps? Your help will be very appreciated.

    Thank you

    You can export a calendar in a SET, then import it back and add, in the second schedule. In order to develop more... you have two appendices A and B. Export to a file SET. Open B, then import the x from A to B. Under Options project to import in the import, import action Wizard, choose Add in the existing project.

    I hope this helps!

  • How to combine two or more projects into one

    I have about 11 months of video editing experience. I started with a Sony HDV Handycam (tape) and now use a different Sony Handycam it has internal memory.

    I've upgraded to faster and more powerful computers (3 times in the last year). I have 3 computers - one with an Intel i7 64 bit running windows 7, a second with Intel core 2 Quad running vista 32-bit and Intel core 2 duo laptop running Windows 7.

    I have two editing Corel Video Studio Pro X 2 and first Adobe Elements 8 applications. Each came with the strengths and weaknesses.

    I am disappointed by Adobe regarding how to merge two or more projects into a master project. Working with large video projects is not what I like to do. Ten to 15 mins projects are my favorite length. However, when it comes to burn a DVD and adding projects to the list (this can be done in Pro X 2), I seem to be stuck with burning a DVD separate for each project of first Elements 8. This isn't the way to go if I do work for a client and they want just a DVD.

    I read on a forum and tried to convert an AVI to each project and then inserting each AVI file in my 'master' or final project timeline and then burn a single DVD. This principle works, but the quality of video playback (especially when the subjects are moving) is not acceptable. The edges are saw teeth and the overall quality of resolution is downgraded from the original AVCHD video from Sony handycam camera.

    Not to be too negative on creative adobe 8 elements, he did a great job of editing and burning to DVD with original AVCHD files direct the camera (pre-AVI conversion). I am very satisfied with this part of the application.

    I wish just that I don't have to save or convert each project separate adobe for AVI files in order to combine a number of projects.

    By the way I set up a project that had three blocks in the video (20 seconds) still subject (in this case roses growing in the garden in broad daylight) one block was directly from the camera format AVCHD, one was an uncompressed AVI file is using the options to 'share' in Adobe and third block is a done compressed AVI file also using 'share' in adobe. It was very clear to me that the AVI files are down on the quality of the original AVCHD file of the camera (only slightly better than the compressed AVI uncompressed AVI).

    AND other trouble, it was AVI files reduced the size of the image (same proportions 16:9) and that was disappointing on a HD screen. AVCHD met clear and clean and filled the screen on my 42 '' HDTV files.

    If anyone has had the same problem and can you please help with the concerns that I have.

    Thank you very much

    Paul Hodge

    The possibility of using the individual sequences, when you edit a project, is a force of PrPro. However, there is a difference in price between the two programs. You have to ' get something for your $, right? Personally, I created my PrPro sequences like "chapters" change like that and then export each sequence import into Encore to create.

    Pre, Steve to edit a project and then export as DV - AVI, technical for import in 'the master' project for the creation of final on DVD, is the best method. Were I not also on PrPro, this is exactly what I would do. It works perfectly. When all is said and done, there are no other measures, as for me, using PrPro and again. PrE was capacity-building, albeit somewhat limited, if a user does not need to transfer AV files to another program (in my case).

    Good luck

    Hunt

  • How to combine two user accounts

    I created a user account on my new MBP (os x 10.11.3) before using the migration assistant to transfer the data from my old MBP.

    Now I have 2 user accounts I need to merge into one

    Any advice for how to fix the welcome.

    THX & br - gerhard

    lookie here

    Combine two + accounts on the same machine

  • How to attach two photos with window live photoshop

    How to join two or more pictures with window live photoshop... Please tell me...

    Hi puneetdeol,

    Thanks for posting your question in the Microsoft answers Forum. For any questions about Windows Live Photo Gallery, please visit the following link:

    http://windowslivehelp.com/forums.aspx?ForumID=cafb0556-8959-49b9-AFEB-635314aa02f3

  • How to combine two PDF files without form fields-building

    I have two PDFs with form fields in each. Someone else created the documents. Some fields were untitled and so were given names as "not defined" in each document. However, some of these fields contain different information in each document. When I combine the document, these fields mix and incorrect information to in some areas.

    For example, there is a blank field in the doc A, entitled "indefinite". In the doc B, there is a field with "johnson" titled "indefinite." When I combine, "johnson" appears in the empty field.

    Is it possible to combine the documents without the combined fields?

    The code must be placed in a stage of "Execute JavaScript", you will find under more tools in the Edit Action window.

    Here, you must also add a step to the Sava.

  • How to combine two conditions: there is and point not null?

    Hello!

    I have a flash chart area I would like to show only if two conditions are true.

    The first condition is the following:

    There are (at least a line returns the SQL query):
    select 1
    from    observatoire.fiche aa, observatoire.activite_faite bb
    where   aa.fiche_id = bb.fiche_id
    and     bb.fiche_id = aa.fiche_id
    AND     bb.activites_id = TO_NUMBER(:P23_ACTIVITES_ID)
    AND     TRUNC(aa.date_activite, 'YYYY') = TRUNC(TO_DATE(:P23_ANNEE, 'YYYY'), 'YYYY')
    And the second condition would be:

    Point not null:
    P23_ACTIVITES_ID
    How to combine these two conditions in one display condition?

    Thank you.

    Christian

    Hello

    The problem is that you do-

    TO_NUMBER(:P23_ACTIVITES_ID)

    When you leave the value of Null return like this, you will see "null %" generally used in session state (i.e., it is not actually null). Of course 'null %' cannot be converted to a number, from which the error you see.

    A simple solution would be to make your value null return value-1 or another value that is guaranteed not to be a piece of identification (and alternative is to convert the real null null % thanks to a process of App/Page etc (if you search this forum you will find a few examples on how to do this).) Another alternative is to use a DECODING to detect the '% null' etc.

    Hope this helps,

    John.
    --------------------------------------------
    Blog: http://jes.blogs.shellprompt.net
    Work: http://www.apex-evangelists.com
    Author of Pro Application Express: http://tinyurl.com/3gu7cd
    AWARDS: Don't forget to mark correct or useful posts on the forum, not only for my answers, but for everyone!

  • How to combine two tables: table of origin and its values of interpolation table

    We get a new array of values after using the interpolation on a table function in labview, but how to combine the array of values and this original interpolated set of values in a single table?


  • How to combine two picturesinto one

    I have 2 photos of people and I would like to combine them into a single image

    Hello

    PhotoShop (Adobe) and PhotoPlus (Serif) will allow that and both have communities of support
    and support forums. Of course, these are commercial programs.

    Here are some free ways to help:

    How to combine multiple Digital Photos into one
    http://www.Dummies.com/how-to/content/how-to-combine-multiple-digital-photos-into-one.html

    Check in the Forums of IrfanView.

    IrfanView - free (also get Plug-ins)
    http://www.IrfanView.com/

    IrfanView - Forums
    http://IrfanView-Forum.de/Forum.php

    This research should help to:

    Bing - Vista combine photos
    http://www.Bing.com/search?q=Vista+combine+photos&QS=n&Form=QBLH&PQ=Vista+combine+photos&SC=0-0&SP=-1&SK=

    Google - Vista combine photos
    http://www.google.com/#hl=en&sclient=psy-ab&q=vista+combine+photos&oq=vista+combine+photos&aq=f&aqi=g-v1&aql=&gs_l=hp.3..0i15.2387l9500l0l9943l22l17l1l1l1l0l2003l15023l2-5j2j6-4j3j2j1l19l0.llsin.&pbx=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=50aeccfec5fc8449&biw=1024&bih=713

    I hope this helps.

    Rob Brown - Microsoft MVP<- profile="" -="" windows="" expert="" -="" consumer="" :="" bicycle="" -="" mark="" twain="" said="" it="">

  • How to combine two different accounts into one?

    We have an account at work that has a subscription of cloud on that and I also have a separate for work as I can access only. How am I supposed to combine the two is multi-user account? My account has expired so I need re-new anyway with the other one.

    Help, please!

    Since this is an open forum, not Adobe support... you must contact Adobe personnel to help

    Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">

    Don't forget to stay signed with your Adobe ID before accessing the link below

    Creative cloud support (all creative cloud customer service problems)

    http://helpx.Adobe.com/x-productkb/global/service-CCM.html

    For a computer to work, you may need a TEAM account

    - https://creative.adobe.com/plans?plan=team team plans

    -http://www.adobe.com/creativecloud/buy/business.html

    -https://helpx.adobe.com/contact/creative-cloud-teams.html using the team

    -manage your account http://forums.adobe.com/thread/1460939?tstart=0 team

  • How to combine two different bookmarks lists into a single list?

    I try to combine the two lists of bookmarks. One of the IE and the other of Google Chrome. I created two HTML Firefox files for each and they are listed in my tab of Firefox bookmarks separately, but I want to combine and more written duplicate or manually delete the bookmark if there is a duplicate.

    Open the HTML files and then CTRL + SHIFT + B (or show/organize all bookmarks) then open the folder you want to left click on the mouse for the first bookmark , then shift + down arrow on the keyboard to catch everything then in Organize menu choose transfer (or move) , select the folder you want and click OK.

    Exit Firefox and restart.

    Thank you

    Please check 'Resolved' the answer really solve the problem, to help others with a similar problem.

  • How to combine two accounts administrator an administrator account?

    I have images and documents in two accounts different administrator (one was mine and the other was my ex-husband now). I activated the photos to share with other administrator accounts. I would like to remove one of the accounts without loss of images and documents. How can I do this safely?

    Hello

    Make a NEW ADMIN account with your password even to use to test and correct with right now. He is a 3rd account
    who will not normally be used or contain actual data. Always keep an unused ADMIN to test and difficulty as
    necessary. (This is not compulsory but is very careful to do.) This account can be the one that you use to migrate
    the data you want to keep his account to your own.

    Simply copy the files you want to keep the account you want to use.

    If you really want to get inside this method fully and pretend that his account is the corruption and yours
    is the new (don't forget your account is already created and do not delete all the data in it).

    Difficulty of a corrupted user profile
    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    I hope this helps.

    Rob Brown - MS MVP - Windows Desktop Experience: Bike - Mark Twain said it right.

Maybe you are looking for