How to create an Area(or shape) from a set of points?

In fact I want to accomplish a function which can fill an area of same color on an image, just like the Magic Wand tool in Photoshop.
I have written a function to figure out the points which should be included in the Area, but I don't know how to create the Area from a set of points...:(
I tried to create Rectengel2D from each point, the union them one by one, but it's too slow
Anyone can help me? Thanks

you should look att the fillPolygon api instead, it can draw more than one corner.
I would use it in a paintComponent method and a method that creates the x and y cordinates for each corner.
API HELP:
http://jdrawing.sourceforge.net/doc/0.2.1/api/org/jdrawing/graphics/FillPolygon.html

Similar Messages

  • Create an area from a set of points

    How to create an area from a set of points ? I searched everywhere but could not find a better solution for it. Let�s say that I have a matrix that contains the points for a shape. I�ll need a way to connect the points near each other continuously to form the outline for the shape.
    Thanks fro any feedback.

    ... But I'll also need a way to connect
    those points in an order so that they'll form the
    path (edge) of the shape.Do you mean the Convex Hull [1] of a set of points?
    If so, you could find it by implementing a Graham Scan [2] algorithm and then calculating the area of the polygon [3].
    [1] http://mathworld.wolfram.com/ConvexHull.html
    [2] http://en.wikipedia.org/wiki/Graham_scan
    [3] http://mathworld.wolfram.com/PolygonArea.html

  • How to create automatic creation of BP from customer and vendor master data

    Hi gurus,
    can any one tell how to create automatic creation of BP from customer and vendor master data.
    Please give me the steps.
    Thanks
    Sasikanth.

    HI,
    Goto SPRO\ Cross application components \ Master data synchronization \ Synchronization control.
    Assign account groups of customer and vendors to respective BP grouping. This setting is enough to create BP in background while creating customer / vendor. But the fields groups are very much important, ensure mandatory fields should be sync.
    rgds,
    Srini

  • How to create a interface with NTR from SAP XI?

    How to create a interface with NTR from SAP XI?

    Hi,
        What do you mean by NTR ?...
    What are the details you needed...Please be clear and more elaborative as far as possible..so that you will get straight forward answers...
    HTH
    Rajesh

  • How to create a group of contact from a multi-selection of mails in a mailbox to answer to all senders?

    How to create a group of contact from a multi-selection of mails in a mailbox to answer to all senders?

    Use Mail Scripts. Its Add Addresses function will collect all the addresses from all selected messages and allow you to select the ones you want to add and allow you to create groups as you go.

  • How to create info area for process chains?

    How to create info area for process chains?

    Hi,
    If I understand your question clearly, you want to assign display componets.
    once you have created you chain you assign the components by clicking CTRL+F11
    Regards,
    Namrata

  • How to create an Area and place main windows in scripts

    How to create an Area and place main windows in scripts ?

    hi prasad,
    jst create a page first and define page windows.
    here u can specicify whether the window is main or secondary.
    to adjust the window goto form  painter  do the adjustment.

  • How to create ArrayColletion in mx:Script from mx:Model id="results" source="/data/data.xml" /

    How to create ArrayColletion in mx:Script from <mx:Model
    id="results" source="/data/data.xml" />
    Please see my code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Model id="results" source="/data/data.xml" />
    <mx:Script>
    import mx.collections.ArrayCollection;
    import mx.utils.ArrayUtil;
    import mx.controls.Alert;
    </mx:Script>
    <mx:ArrayCollection id ="dt1"
    source="{ArrayUtil.toArray(results.result)}"/>
    <mx:Script><![CDATA[
    [Bindable]
    public var expenses:ArrayCollection = dt1;
    [Bindable]
    public var expenses2:ArrayCollection = dt1;
    [Bindable]
    public var dp:ArrayCollection=expenses;
    public function changeDataProvider():void{
    Alert.show(expenses.toString());
    if (dp==expenses){
    dp=expenses2;
    }else{
    dp=expenses;
    ]]></mx:Script>
    <mx:Panel x="10" y="10" width="100%" height="378"
    layout="absolute">
    <mx:ColumnChart dataProvider="{dt1}" x="10" y="10"
    id="myChart" height="318" width="100%">
    <mx:horizontalAxis>
    <mx:CategoryAxis categoryField="month"/>
    </mx:horizontalAxis>
    <mx:series>
    <mx:ColumnSeries displayName="apple" yField="apple"/>
    <mx:ColumnSeries displayName="orange"
    yField="orange"/>
    <mx:ColumnSeries displayName="banana"
    yField="banana"/>
    </mx:series>
    </mx:ColumnChart>
    <mx:Legend dataProvider="{myChart}" x="481" y="10"/>
    </mx:Panel>
    <mx:Button x="284" y="416" label="Change Data" id="bt"
    click="changeDataProvider()" />
    </mx:Application>

    Tracy,
    Thanks. That worked. However I have another related question:
    I convert the xml feed to a XMLListCollection by doing:
    <mx:XMLListCollection id="mission"
    source="{xmlFeed.lastResult.day}"/>
    and
    <mx:XMLListCollection id="mission1"
    source="{xmlFeed.lastResult.day.tBlock}"/>
    On the chart I have
    <mx:ColumnChart id="missionReadiness" height="150%"
    width="100%"
    paddingLeft="2" paddingRight="2"
    showDataTips="true" dataProvider="{mission1}">
    <mx:series>
    <mx:ColumnSeries xField="" yField="@today"
    displayName="Today"/>
    <mx:ColumnSeries xField="" yField="@tomorrow"
    displayName="Tomorrow"/>
    <mx:ColumnSeries xField="" yField="@afterT"
    displayName="After Tomorrow"/>
    </mx:series>
    </mx:ColumnChart>
    the yField works, but for the xField I want to have the @date
    but refers to the parent node, so I am clueless on how to refer to
    it.
    Also, I would like to display on the chart only the values to
    a specific date (like @date="05/17/2007").
    Any suggestions on how to do that?
    Gilbert

  • Create waveform from a set of points with differtent time intervals

    Hello,
    I would like to create a waveform from a set of points like this
    Time           Data
    0                 0
    0,5              1
    0,6              2
    1                 1
    2                 0
    5                 1
    The problem is that the time interval between each points are not the same.
    The only idea I found was to create a waveform for each doublet of points with the same rate (100ms) and than to append them together.
    Does anybody have a better idea?
    Regards,
    Risotto.

    If you use a Wave From data type, re-sampling is not required.
    When using a WF datatype the chart (graph) will pick-up the X value from the t0 of the waveform.
    The trick is to just build an array of the single update value and make sure the t0 value is correct.
    Re-create this example
    and try it for yourself.
    Ben
    Note: make sure the data you pass is consistant with the data already displayed. If you post a t0 value that is older than what is already displayed, the chart will clear the display and start over.
    Message Edited by Ben on 09-15-2006 11:49 AM
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    WF_Datatype.JPG ‏59 KB

  • How to create Web services to communicate InfoPath forms to Share Point lists ?

    How to create Web services to communicate InfoPath forms to Share Point lists ?

    Hi,  
     As per your posting and my understanding, you wanted to communicate your infopath with SharePoint list/library. Please refer the below link(s) which may help you to solve your issue.
    http://blogs.msdn.com/b/russmax/archive/2012/08/17/want-to-call-sharepoint-2010-web-services-within-browser-based-infopath-2010-forms.aspx
    http://jaliyaudagedara.blogspot.in/2011/03/submitting-data-to-sharepoint-2010-list.html
    or 
    http://blogs.msdn.com/b/infopath/archive/2007/03/26/submitting-to-a-sharepoint-list.aspx
    If you need more help please let usknow
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever you
    see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to create a 4 page pdf from images - each page should open at same size

    How do I create a 4 page pdf (from 4 images - all the same size) that opens each page at  full page size?
    Thank you so much.
    Ginger
    PREVIOUS MSG:
    My goal is to create multi page pdfs that are created from images (scans of old brochures).  I receive images (scans of pages) all at the same size.
    I have been able to create the 4 pdfs (each opens at full page size) and merge into 1 pdf.  When I open that final pdf, I  see a column of 4 pages, page 1 image being larger than the remaining 3. When I  click on the left, page 1, icon,  I get the full page.  When I click on icons for pages 2 - 4, I get nothing.  The only way I can get the other pages in a full page view is to adjust the scaling after left icon is selected.  That is not what I want.
    How I created the files.
    I can either create pdf pages using Photoshop, or using Acrobat Pro itself through:
    File> Create PDF> From File and adding each of the images.  I then, for each, choose Properties> Initial View> Fit Page> Save. Then I use File> Combine> Merge Files into Single PDF> Save.
    Then I open the multi page pdf.
    I appreciate any help.
    Thank you,
    Ginger
    PREVIOUS MS

    It seems to me what you want to do is create one document which a combination of all four  and then one page of each.
    To create a Document with 4 pages combined in to one PDF.  open the first in a Series the to Edit menu and click on add pages click on next document (browse to document first) the choose attach to to end of document or add to  end of document. Repeat until you get all images added. They will end up (or should ) center in center of their own page. Save this document with a new name for now.
    Next go back to Photo shop and reduce size of images to fit desired sheet of paper (8-1/2 by 11, 8-1/2 by 14, whatever) place them side by side and row by row so you have 4 images on one page.
    now save as Pdf.
    now decide which you want to swap to the Thumbnails (the 4 on one page, or 4 individual pages.  I would use the thumbnails and make each a button that references the page in the document you save as a 4 page pdf that applies.
    Then on that page write a line saying click each illustration to see full size image (you might have to write this line while in Photoshop) then save this as PDF file
    Try out. You might have to use some javascript controls to do this. But I am not experienced in JavaScript to do this. I'm sure it cane be done.
    But note you will have to save both documents with the Thumbnails and the four page and Thumbnail page in a folder and send to prospect
    If you want just four separate pages in one Pdf just do first two paragraphs above

  • How to create a report in EM from scratch level ?

    Hi,
    Can anybody help me on this ?
    The report I want to create in EM is about where the user selects a target from a drop down and it shows the CPU utilization or memory Utilization for that respective target. Is it possible to create such kind of ? If Yes, How to create the report ?
    Thanks in advance.

    Are you sure you want to create a report for this info?
    As CPU and MEM utilization changes every second, what would be the use of a report?
    I assume you are aware of the fact that CPU and MEM utilization is included for instance in the Host Homepage and can also be included in Group Pages and Dashboards.
    Regards
    Rob
    For more information on OEM GC, like Tips and Tricks please see: http://oemgc.wordpress.com

  • How to create a vertical bar chart from a table? (PHP, HTML and CSS)

    Hi everyone,
    I have created a table and wish to proceed to do it even better in terms of analysis pattern. I want
    to create a vertical bar chart from the created table but I dunno how to start it.
    Here is the code for the table:
    <?php
    $gpa11=$_REQUEST['gpa11'];
    $gpa12=$_REQUEST['gpa12'];
    $gpa21=$_REQUEST['gpa21'];
    $gpa22=$_REQUEST['gpa22'];
    $gpa31=$_REQUEST['gpa31'];
    $gpa32=$_REQUEST['gpa32'];
    $gpa41=$_REQUEST['gpa41'];
    $gpa42=$_REQUEST['gpa42'];
    $gpa51=$_REQUEST['gpa51'];
    $gpa52=$_REQUEST['gpa52'];
    ?>
    <!doctype html>
    <html lang="en">
       <head>
          <meta charset="utf-8">
          <meta name="viewport" content="width=1024">
          <title>Feng Mentor Mentee</title>
       </head>
       <body>
          <div id="wrapper">
             <div class="chart">
                <h3>GPA Performance Graph</h3>
                <table id="data-table" border="1" cellpadding="10" cellspacing="0"
                summary="The performance of students throughout the years in university">
                   <thead>
                      <tr>
                         <td> </td>
                         <th scope="col">Year 1</th>
                         <th scope="col">Year 2</th>
                         <th scope="col">Year 3</th>
                         <th scope="col">Year 4</th>
                         <th scope="col">Year 5</th>
                      </tr>
                   </thead>
                   <tbody>
                      <tr>
                         <th scope="row">Sem 1</th>
                         <td><?php echo $gpa11;?></td>
                         <td><?php echo $gpa21;?></td>
                         <td><?php echo $gpa31;?></td>
                         <td><?php echo $gpa41;?></td>
                         <td><?php echo $gpa51;?></td>
                      </tr>
                      <tr>
                         <th scope="row">Sem 2</th>
                         <td><?php echo $gpa12;?></td>
                         <td><?php echo $gpa22;?></td>
                         <td><?php echo $gpa32;?></td>
                         <td><?php echo $gpa42;?></td>
                         <td><?php echo $gpa52;?></td>
                      </tr>
                   </tbody>
                </table>
             </div>
          </div>
       </body>
    </html>
    Here's the look:
                                                              GPA Performance Graph                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
    Year 1
    Year 2
    Year 3
    Year 4
    Year 5
    Sem 1
    Sem 2
    Please help me on this because this is my 1st project on php.

    Hi
    Are you using BI query? If yes then follow the steps -
    1. Take Sales org in rows of BI query. & take invoice type & Key figure in Columns.
    2. In VC use this query & drag chart from the output of this query.
    3. Right click on chart & go to 'Configure Element'. There select Chart Type as 'Bar chart'
    4. Below that you will get default option as clustered, there you select 'Stacked'
    5. Create Data series as per your requirement.
    6. Arrange proper layout of the model & then deploy.
    You will get required output in stacked format.
    Regards
    Sandeep

  • How to create a Demand in RPA from Service Request?

    Hi All,
    Could you please explain me how to create Demands to be shown in RPA when Service Request's status is set to Released.
    I have done the below mentioned configurations so far.
    Marked the "Resource Planning Relevance" in zitem category (copy of SRQI), created a Status profile with Released status with System status "RELE" and assigned this profile to ztransaction type (copy of SRVR).
    Generally, Service Orders are referred as Demands and the released service orders are shown in RPA to assign to the most suitable and available service engineer.  But our requirement is to create demands from Service Requests instead of Service Orders. 
    Please explain me how to proceed for this scenario.  What are the settings do I have to perform in CRM system? 
    Kindly help me with your inputs.
    Regards,
    Maddy

    Hi Anais Jaussaud,
    Thank you very much for your reply. 
    My issue now is, after setting the status to Released in Service Request and saved, I checked for the demands in Resource Planning but the released Service Request is not displayed in Demands. 
    I had performed the settings mentioned above in my first post.
    Please help me with what is missing..
    Regards,
    Maddy

  • How to create bootable USB thumb drive from Lion on Mac Mini 2011?

    Hello folks
    Yesterday my new Mac Mini (Core i7 2,7 Ghz, 4 GB RAM, ATI Radeon HD6630M 256 MB) arrived. It replaces my old Mac Mini (Core Duo 1,83 Ghz, 2 GB RAM, Intel GMA950 64 MB). One day I'll replace the 500 GB 5400 RPM HDD in this Mini by an Intel SSD drive (just like I did with my previous Mini). I'll do a fully clean install then (formatting the SSD drive in Disk Utility and then installing Lion on it from a bootable USB thumb drive). The only problem is I can't seem to download Lion for free from the Mac AppStore (MAS) although I have bought a new Mac Mini which came with Lion pre-installed. I know how to create a bootable USB thumb drive with Lion on it when you download it from the MAS. But that's the problem... I can't seem to download Lion from the MAS for free. When I open the MAS while holding down the Option key I can download Lion but it will charge me for it. Is there any way I can download Lion from the MAS without paying for it? Since it already came with my new Mac Mini 2011 this should be possible I guess?
    And will I still be able to download the iLife '11 apps (iPhoto, iMovie and Garageband) for FREE that came with my new Mac Mini when I do a fully clean install as described above? Thanks in advance.
    Greetings
    Jocau

    After doing some research, it seems that there are only 2 WAYS to do a complete reinstall of Lion on the Mac Mini 2011 without paying for the Lion download in the Mac AppStore (i.e. recreating every partition, also the Recovery HD partition, from scratch e.g. when installing Lion on a clean HDD/SSD).
    1) COMPLETELY clone the Mac Mini 2011 HDD including all of its partitions to an external drive and restore it when you want to do a complete reinstall.
    2) Use the LION INTERNET RECOVERY feature built-in into new Macs that ship with Lion (this feature is present in new Macs starting from the Mac Mini 2011 and Macbook Air 2011).
    OS X Lion: About Lion Recovery 
    Lion Internet Recovery
    If you happen to encounter a situation in which you cannot start from the Recovery HD, such as your hard drive stopped responding or you installed a new hard drive without Mac OS X installed, new Mac models introduced after public availability of OS X Lion automatically use the Lion Internet Recovery feature if the Recovery HD (Command-R method above) doesn't work. Lion Internet Recovery lets you start your Mac directly from Apple's Servers. The system runs a quick  test of your memory and hard drive to ensure there are no hardware issues.
    Lion Internet Recovery presents a limited interface at first, with only the ability to select your preferred Wi-Fi network and, if needed, enter the WPA passphrase. Next, Lion Internet Recovery will download and start from a Recovery HD image. From there, you are offered all the same utilities and functions described above.
    As with the Recovery HD, reinstallation of OS X Lion from Lion Internet Recovery requires an Internet connection. See "Supported network configurations and protocols" below.
    Restoring iLife applications after Internet Restore of OS X Lion
    If you reinstall Lion on a new Mac that shipped with OS X Lion installed, on an erased or replaced hard drive, you can download iPhoto, iMovie, and GarageBand from the Mac App Store.
    After installation, start from Lion.
    Double-click the App Store icon in the dock.
    Enter your Apple ID and password.
    Click Purchases.
    If you haven't previously accepted your bundled iLife applications within the Mac App Store, you should see your iLife applications appear in the Accept portion of the screen. Click Accept.
    You may be asked for your Apple ID and password once again. Your iLife applications now move to the Purchased section. These applications are part of the software that came with your Lion based computer. Your account will not be charged for them. Click Install to compete installation of your applications.
    Source: Lion Recovery
    It's a bit sad that these seem to be the only 2 options. Lion Internet Recovery is the preferred one here since my monthly internet traffic limit isn't a problem (but my download speed is). This problem could have been easily solved by Apple by just checking the system specs or serial number when trying to download Lion from the Mac AppStore. By using one of the 2 options in my previous sentence the Mac AppStore could see that I have a new Mac Mini 2011 that ships with Lion which would give me the option to download Lion from the Mac AppStore for free and eventually create a bootable USB thumb drive of it.

Maybe you are looking for

  • HT204053 Can I merge my apple IDs?

    I just got an ipad mini and tried signing in with my "boodahpuhnk" apple ID, but it said it needed to be an e-mail, so i used "[email protected]" which is the mail associated with my "boodahpuhnk" ID. But now when I log in to the itunes store with "[

  • XML Parser Exception in Install of AIA 11.1.1.5 on SOA 11.1.1.5

    I am attempting to install AIA Foundation Pack on a SOA domain and continually encounter an XML parsing exception error as the installer is attempting to install WSM security policies. Here are the key details: AIA version = 11.1.1.5 SOA Suite = 11.1

  • Unable to print a photo from Adobe Photoshop elements 9.

    When I press print from the Photoshop print set-up window,  all I get is the HP fax set-up window. I've unplugged the printer, removed the HP printer program and reinstalled it and all I still get is the fax setup window.  I've also used HP's downloa

  • How to move the custom hooks in /etc/rc.d/functions.d to systemd

    I have a few scripts placed in /etc/rc.d/functions.d that were launched during the boot process. Now I moved to systemd but I have not found any documentation about how to implement those hooks in the new boot process. As far as I got I need to write

  • Mac book air capacity

    is mac book air capable of supporting auto cad, hyperworks ,catia  proe ,etc