How to rasterize a chart that contains data from the path?

In this function, when I type = 5 (create the path object), the object of trace appears on the canvas, but the BitmapData is empty. What I am doing wrong?

public function createRandomObject (): Object

{

var MAXX:Number = 700;

var MAXY: Number = 500;

var MINRADIUS:Number = 20;

var MAXRADIUS:Number = 100;

var MAXHEIGHT:Number = 100;

var MAXWIDTH:Number = 100;

var MINHIEGHT:Number = 20;

var MINWIDTH:Number = 20;

var NUMTYPES:Number = 5;

xPos var = Math.floor (Math.random () * MAXX);

yPos var = Math.floor (Math.random () * MAXY);

type var = Math.floor (Math.random () * NUMTYPES) + 1;

var color: uint = Math.floor ((Math.Random () * 0xFFFF00) + 0x0000FF);

graph: graph of var = new Graphic();

graphic.graphics.beginFill (color);

type = 5;

var width: Number = Math.floor (Math.random () * (MAXWIDTH-MINWIDTH)) + MINWIDTH;

var height: Number = Math.floor (Math.random () * (MAXHEIGHT-MINHIEGHT)) + MINHIEGHT;

Switch (type)

{

case 1: //circle

{

var radius: Number = Math.floor ((Math.random () *(MAXRADIUS-MINRADIUS))) + MINRADIUS;

width = height = radius * 2;

graphic.graphics.drawCircle (RADIUS, RADIUS, RADIUS);

break;

}

case 2: //square

{

height = width;

graphic.graphics.drawRect (0,0, width, height);

break;

}

box 3: //rect

{

graphic.graphics.drawRect (0,0, width, height);

break;

}

box 4: / / ellipse

{

graphic.graphics.drawEllipse (0,0, width, height);

break;

}

case 5: / / SVG path

{

var pathData:String = "M 0 L 0 40 0 40 40 40 0 L L Z;

var pathData:String = « M 247 153 L 0 400 400 800 609 800 695 800 696 801 722 873 749 802 774 827 801 801 827 827 852 802 879 873 905 801 906 800 993 800 1201 800 1601 400 1201 0 801 400 400 0 247 153 Z » ;

path: path of var = new Path();

Path.Data = pathData;

Path.x = 0;

Path.y = 0;

Path.Width = 200;

Path.Height = 200;

Path.Stroke = New SolidColorStroke();

Path.Fill = New SolidColor (0xFFFFFF);

Path.Winding = GraphicsPathWinding.EVEN_ODD;

path.validateNow ();

graphic.addElement (path);

Graphic.Width = 200;

Graphic.Height = 200;

width = path.width;

height = path.height;

}

}

graphic.graphics.endFill ();

var FillColor = 0xFF000000;

mainCanvas.addElement (graphic);

var bitMapData:BitmapData = new BitmapData (width, height, false);

bitMapData.draw (graphic); It's empty when type = 5 (path data)

Graphic.x = xPos;

Graphic.y = yPos;

var dataObject:Object = new Object();

dataObject.bitMapData = bitMapData;

dataObject.XPos = xPos;

dataObject.YPos = yPos;

dataObject.spriteName = graphic.name;

Returns the dataObject object;

}

So I thought to it. Paths use BeforeDraw() and EndDraw(), making the filling operations and outline Draw(). The problem is that these functions not called until the path is rendered on the canvas. So, I expanded my class path and too rolled the EndDraw() function. In this function, I sent an event. Then, when I catch the event I can get the DisplayObject of the track (which is now filled) and pass this object in BitmapData().

Tags: Adobe Animate

Similar Questions

  • How can I get a report containing data on the current month and the next month

    How can I get next month?
    I want a report that include data on the current month and next month.

    My solution is "Closing Date". "" Fiscal month "> = Valueof (NQ_SESSION. CURRENT_MONTH)
    S 'closing Date '. "" Fiscal month "< = MONTH (CURRENT_DATE + 30)

    But this show only the information between the current month and the date of the day + 30 days

    Does anyone have a better solution?

    You can meet the next email [email protected].

    Greetings!

    GON,

    Add the near field date in your report, add a filter and choose between. Place the cursor in the first box and select Add - SQL expression, paste into the first expression that I gave you. Repeat for the 2nd box and voila it will filter you need. If you are unsure, then use the superior / equal to the value for the first term and the lower than the 2nd.

    see you soon
    Alex

  • How can I use notifications to send data from different sources for the same chart?

    Hello

    I use the model of 'Continuous measurement and logging' project comes with LV 2013.

    It is extremenly helpful in understanding the messaging between the acquisition, graphic and loops of newspaper. (Thank you NEITHER!)

    I ran into a snag though.

    I want to change so that my graphic loop receives notifications of data from two sources of acquisition by the declarant.

    I have trouble getting the data from the two sources to display on one graph.

    I've isolated the problem in the attached vi.

    Here's what happens:

    1. I create 2 parallel loops data and send the data to a third parallel loop with the notifiers.

    2. the third loop receives data from one of the loops because one of the authors of just receiving notifications is to expire instead of receive data.

    Can anyone suggest how can I fix?

    Thank you.

    -Matt

    Here's my modification of your VI. I put notes on the block diagram to explain the changes. He uses a queue for data transfer to avoid data loss. It uses a notifier to stop loops. All local variables and value property nodes have been eliminated.

    The way loops are arrested probably let some data in the queue. No more of one or two iterations of each of the loops of data acquisition. If you need ensure that all data has been displayed (or recorded in a real application), then you must stop acquiring loop first and read the queue until you know it's empty and both other loops stopped. Then stop the render loop and release the queue and the notifier.

    Lynn

  • How to open an attachment that contains a .ows file?

    I need to open an attachment that contains a .ows file. I don't see this file extension when I look in my entire Associations. My computer is Windows 7. What should I do to open the file or add the .ows extension to my associations together?

    Original title: .ows file

    Hello

    Thanks for posting in the forum the Microsoft community.

    Unfortunately, the .ows files are not supported by Windows 7, but you can use your favorite search engine to download and install a program according to the file type, you must use.

    NOTE: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

  • How to break a software, that contains the playlists, mp3 format

    Hi all

    I have a few (exe file) educational software that I got from a friend. and there a few lectures in video Formate and combined into playlists. I want to break it up and get the mp3 files and listen to rather then to look at the Conference. so I can listen at any time.

    Concerning

    Thanks for the quick reply all the

    Hello

    Here to separate the audio from video you must have third-party software, which will help you to separate the audio from the video.

    You can use your favorite search engine and search the Internet for audio that separates the software.

    THIRD PARTY SOFTWARE or LINK WARNING

    With the help of third-party software or a link, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third party software or link can be resolved. Using third-party software or a link is at your own risk.

    If you want to suggest changes in the design here is the link you can make reference to: Microsoft Connect - back products and bug reports. Microsoft...

    https://connect.Microsoft.com/dashboard/Info/

    Thank you, and in what concerns:

    Suresh Kumar-Microsoft Support.

    Visit our Microsoft answers feedback Forumand let us know what you think.

  • How to connect sql database to esxi to save all data from the virtual machine

    How to connect sql database to esxi to save all data from the virtual machine

    Please provide steps

    In simple terms, you cannot connect ESXi to SQL. Connect a vCenter SQL (Windows only).

    If you want to save all the data that is contained in your virtual machines, I suggest a backup solution.

    Suhas

  • How to extract specific data from the user to view?

    Hello

    I have a requirement I need to display only the Session_user-specific data in the table. Scenario is that if the user belongs to a specific region should be able to see data for that specific region only.

    I think passing the session_user view query name but don't know if it of possible or not. If possible how to do this.

    What is the best way to achieve this?

    Thank you

    Angelica

    Hello

    If you use the ADF for authentication security, the user name is then accessible from the context of the ADF in British Colombia ADF. You can then

    1. create a view of the criteria in British Colombia ADF to a specific view

    2. set the display criteria to use a variable binding

    3. use groovy to add the value of the bind variable

    -set the type of value of 'Expression '.

    -Add adf.context.securityContext.userName

    4. go in the Module--> Application data model

    5 Select the instance of the View object

    6. press on "change."

    7. Select the view test

    If you download the example in this article: Oracle ADF: security for everyone so you see that users have a profile page containing data for the authenticated user. Sound by using the method described above

    If you do not use ADF security you can always use this approach. Instead of providing the value of the variable bind using Groovy you can run the view object using executeWithParams operation in this case, you can read the value of the authenticated user to the side view ADF. The binding variable would not be set to the Expression in this case though.

    Frank

  • How can I do a new insert data in the other table extrancting?

    Hello, I'm looking how to do an insertion of two tables save values and apply to other tables like this:

    The insert I'm looking for is something like this:

    Have two tables, the first table is emp1 and contains the column: data 1 and 2 with line of data1: 1234 and line data 2:5555, therefore,.

    I want to create an insert on a new table called (emp2) that contain the data in the column: data 1, data 2 (from the first table demo1), data 3, data 4, etc.

    How insert again I can put / call data from another table insert in this table (emp2).

    I don't know if my example is correct (my English is very bad).

    This is an example: (sorry for the points).

    table EMP2:

    1 data... 2 data... 3 data... data 4... data 5
    (from emp1)... (from emp1)... 8534... 2347... 4544

    Thanks for the help.

    Published by: user10182692 on 24-May-2009 08:39

    Published by: user10182692 on 24-May-2009 08:40

    Published by: user10182692 on 24-May-2009 08:45

    Welcome! on the forum.

    You can include the code and data in the {code} tags

    If I'm good, and I know what is your condition

    insert into emp2 ( data1, data2)
    select data1, data2
    from emp1
    

    SS

  • How to send data from the client to the server using tcp

    1. as I am new to watch I need help with sending data from client to server. I went through various examples of labview, but each of them also explains transfer of data to the client server. But I need help regardng send data from the server to the client.

    2.i would use the data type variant for sending my data.

    Can someone help me please. Thank you

    Regardless of the meaning. Once you have a connection each end allows it to send data to another. Just create what you want to look like interaction.

    Do you want the client sends a command that request data?
    How do you think the response data to look like?

    You can send variants, but probably not worth the effort.

    Mike...

  • How to read the two columns of data from the Port series

    Hello

    I'm reading two columns of data from the serial port.

    Example:

    52439 52430

    52440 52437

    52209 52214

    51065 51070

    52206 52390

    I use the serial of Visa service and I can read the first column of data from the serial port, but I can't understand how to read the second column.

    I want to both sets of chart data.

    I enclose my VI.

    Thank you for your help.

    The analysis of string function takes a "Format string" on top (with the right button of the function and choose Help, which explains all the entries).  In particular, you can say 'Give me two numbers separated by a tab' and the output will be two numbers (whole or floating, depending on the chosen format).  In particular, %d\t%d specifies a decimal integer, , whole decimal.

  • ORA-03297: file contains data beyond the requested value of RESIZING

    Hi all
    I am trying to increase the size of my space of system tables. The tablespace contains a data size 900MB file and it may increase to 2 GB.
    I would like to change this to autoextend I'll operate on the database csscan.
    When to change the autoextend and unlimited file I get: ORA-03297: file contains data beyond the requested value of RESIZING

    I also tried to increase the data file of 4 GB, but still the same. I see that there is more then enough space on the file system.
    Need help.
    Oracle Enterprise edt 10.2.0.5
    Concerning
    933746

    The first statement is that originally the problem - you try to shrink the file, develops it not.

    The autoextend (second statement) should be fine as is.

  • How to use record group to insert data into the hierarchy tree?

    Hello

    I had a hierarchical tree in my block and I want to use the record group to display
    in the hierarchy tree, call david_tree. He did work for the code I try below
    and I think it might be that the create_group_form_query was wrong? or miss an order?


    DECLARE
    htree;
    rg_data RECORDGROUP;
    v_ignore NUMBER;
    BEGIN
    htree: = Find_Item ('tree_block.david_tree');

    rg_data: = CREATE_GROUP_FROM_QUERY ('rg_bank',
    "select name, short_name".
    || "from css_banks");

    -Fill the record with data.

    v_ignore: = POPULATE_GROUP (rg_data);

    -Transfer the data from the record group to the hierarchical
    -tree and bring it to display.

    FTREE. SET_TREE_PROPERTY (htree, FTREE. (RECORD_GROUP, rg_data);

    END;


    Thank you


    David

    David,
    You get an error with your code? Looks like you took your example code help Forms. I don't really see a problem with the code, but the forms example gives an example of how create the record group used by the HTree so the Receiver General may be the cause of the problem. When I used the HTree, I used the FTREE. Procedure ADD_TREE_DATA to fill the tree. When I started working with HTree I created a wrapper package to simplify the process. You can watch how I work with the HTree in a demo that I published called: forms and how to: create a shape of the HIERARCHICAL tree.

    Hope this helps,
    Craig B-)

    If someone useful or appropriate, please mark accordingly.

  • How to copy the data from the CLOB on Varchar2?

    Hi all
    I have a CLOB field with data, I want to copy all the ot its data to another field of varchar2 to the same table. How, please?
    I think that I should use the Update statement, but how?

    Note: Iam using DB Oracle 10g R2

    You can just do a simple UPDATE, but if you have the adta in your CLOB which is too big to fit in your column VARCHAR2 column, you will not be able to get it all:

    UPDATE my_table SET my_varchar2_column = SUBSTR(my_clob_column,1,[size of my_varchar2_column];
    
  • How to erase data from the iphone if I lost and iphone is offline

    How to erase data from the iphone if I lost and iphone is offline

    < post branched out by host >

    Hello

    What to do if your iOS device is turned off or offline?

    If your missing device is turned off or offline, you can still implement this Mode lost, lockor remote wipe. The next time your device is online, these measures will take effect. If you remove the device from your account while it is offline, pending actions for the device will be cancelled.

    If your iPhone, iPad or iPod touch is lost or stolen - Apple supports

  • How to recover data from the browser tabs?

    Hello

    I am trying to retrieve data from the Firefox browser by dragging the tabs in a Windows/Mac/Linux application. Specifically, I was hoping to capture medadata HTML and video current time (for example, 01:23 05:00) YouTube pages for storage off favorite browser and reactivation.

    I couldn't find an online help or the documentation dealing with this issue.
    Any suggestions?

    Thank you

    There is an additional command that is added at the end of the url of Youtube. You need to add & = t * m * s at the end of the url. Where the asterisks are, replace you them with numbers. For example: http://www.youtube.com/watch?v=Zb7gTeLmpHs & t = 3m24s

    The m is s for seconds and minutes.

    You can also find this information by loading a video from Youtube, by dragging the time slider to the time you want to pause the video, and then right-click on the video and choose:

    'Copy the URL of the video at the present time'.

Maybe you are looking for

  • Apple pays

    Just confirm... has pay Apple again was released in Australia?

  • Car holder

    Hello! I would use my phone Moto G 2nd Gen for navigation, a few times. If anyone knows a good windshield support please share the info with me. Thanks in advance!

  • Error code 0x8100000A when running Backup in Windows Vista

    Original title "" how to create a new file named 0x8100000A? "» My drive of 500 GB external hard back up no more. I have a lot of space. It Laura me to create a new file named 0x8100000A. It also gives me a little window that says "microsoft Windows

  • Reloading the OS Question

    deleted

  • BlackBerry smartphone how to create a dialog box with edit controls

    Hi guys,. I am trying to create a dialog box that has a couple of input fields - one is a selection list (drop-down list), and the other is a text box. I know the custom dialog boxes can be created, but I'm not sure that it is possible to add several