Help needed urgently on how to crop an image

Anyone has sample codes for cropping an image??? Thanks alot cos i just need to know how it works....It's like when the client upload an image, it will crop to a specific size...

U can use.. below format of drawimage for cropping..
drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer)
Also check
http://www.javaworld.com/javaworld/javatips/jw-javatip32.html
for more details..
they also show how to flip image bertically and horizontally..
gervini

Similar Messages

  • HELP need urgently! Pages not loading ANY images in my document.

    Hi all,
    I am writing my thesis for my degree, and my document is quite large. I have ~40 images of various sizes, up to 300kB. Everything was fine last night, and I saved the pages document three times on three different storage devices because I'm paranoid about losing this work.
    I closed Pages last night after saving, and today when the document is opened, every single image has been replaced with a grey square containing a question mark.
    What I can't understand is that when I quick-look the document in finder, it still contains all the images just as it was last night.
    Help with this would be very much appreciated!
    Thanks in advance,
    Graham

    It doesn't say "include", that is the previous check box. It is just Save as.
    Saving to Word (really this export) is not perfect in Pages particularly if you have used any uniquely Pages features.
    Since I can't see what you have done, which is probably something you have not described, it really would be faster just to see the docuument. Currently I am suspecting it maybe inline graphics.
    Peter

  • Some J2ME midlets doubts!! help needed urgently!!!

    Hi,
    I am currently working in a company where it does wireless technology like WAP and I am assigned a task of creating a screensaver midlet. I have some doubts on the midlets.
    1) How do i use a midlet suites? From what I heard from my colleagues & friends, a servlet is needed for midlets to interact with one another. is it true?
    2) How do I get the startin midlet to take note the phone is idling so that the screen saver midlet can be called?
    Help needed urgently... if there is any source codes for me to refer to would be better... Thanks...
    Leonard

    indicates that MIDlet suites are isolated (on purpose) from each other, so you can't write over another one's address space.
    Also, I believe (at least on cell phones) that you have to specifically enter the Java Apps mode; unless you do the app won't execute. If you are in Java apps mode and a call comes in, the cell's OS puts the Java app currently executing on "Pause" mode and switches back to phone mode.
    Not sure if you will be able to have a Java app do that automatically.
    BTW why do you need a screensaver on an LCD display? Is it really intended to show an advertisement?
    Download and real all the docs you can from Sun, once you get over the generic Java deficiencies MIDlet's aren't that hard.

  • Help Needed - FusionFx Style - How do I remove the Dashboard Grey Box Section, so that Dashboard Background is Blank

    Help Needed - FusionFx Style - How do I remove the Dashboard Grey Box Section, so that Dashboard Background is Blank
    We like FusionFx Style but would like to keep the background white like blafp style.

    Can you be a little more descriptive on what you need here and explain what exactly you want to be changed.

  • HT201210 i have an error of no 11. kindly help, needed urgently

    i have an error of no 11. kindly help, needed urgently
    when i try to upgrage my
    iphone 3gs wit 4.1 to new latest 5.1
    it gives the erorr of 11. what that mean? Reply as soon as you can !
    thnx

    Error -1 may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.

  • Load bar at start up, then shut down. HELP NEEDED URGENTLY!!! plss....

    Load bar at start up, then shut down. HELP NEEDED URGENTLY!!! plss..

    The startup disk may need repairing.
    Startup your Mac while holding down the Command + R keys so you can access the built in utiliites to repair the startup disk if necessary or restore OS X using OS X Recovery

  • I have the f4500 all in one printer need to know how to mirror my image

    i have the f4500 all in one printer need to know how to mirror the image in easy terms

    Hi bbfoot,
    If you are having issues setting up your HP printer on your Mavericks machine, you may find the following article helpful:
    OS X Mavericks: Solve printing problems
    http://support.apple.com/kb/PH14142
    Regards,
    - Brenden

  • How to crop an image illustrator

    how to crop an image illustrator

    To edit pixel you should use Photoshop. There are workarounds to crop pixel images in Illy, but all demand that you embed the image. Then it gets converted into the document's color space, which might not be desired. So do your pixel editing in Photoshop.

  • Help needed urgently on a problem..plzzz

    hi..this is a linear congruential generator. I have to implement it and i need the execution time for the program.
    for your understanding i'm providing an example below.
    Xn=(( a* xn-1 )+b) mod m
    If X0=7 ; a = 7 ; b =7 ; m=10
    Then
    X0 = 7
    X1 =((7 * 7) + 7))mod 10 = 6
    X2 = ((6*7)+7))mod 10 = 9
    X3 = ((9*7)+7) mod 10 = 0
    X4 = ((0*7)+7) mod 10 = 7
    Now since the cycle is being repeated i.e 7 appears again�so the period is 4 coz there are 4 diff nos. i.e 7,6,9,0�..
    help required urgently....your help will be appreciated...thankyou..

    Hi,
    I wrote the code so that it catches any cycle (not only the "big" one).
    Otherwise it will enter infinite loop...
    The time complexity is O(N*logN): it can do at most N iterations (here N is your 'm'), and in each iteration there can be O(log N) comparisons (since I maintain TreeSet).
    Interesting issue: is it possible to supply such (x0, a, b, m) tuple such that all possible values from 0 to m-1 will be output? I think no :)
    Here is the program:
    package recurr;
    import java.util.TreeSet;
    import java.util.Comparator;
    public class Recurrences {
         private static long x0, a, b, m;
         private static TreeSet theSet;
         public static void main(String[] args)
              long l0, l1, l2, l3;
              try {
                   x0 = Long.parseLong(args[0]);
                   a = Long.parseLong(args[1]);
                   b = Long.parseLong(args[2]);
                   m = Long.parseLong(args[3]);
              } catch(NumberFormatException nfe) {
                   nfe.printStackTrace();
              System.out.println("X[0]: " + x0 + "\n");
              long curr = x0;
              boolean cut = false;
              int i;
              // initialize the set
              theSet = new TreeSet(new LongComparator());
              // we can get at most m distinct values (from 0 to m-1) through recurrences
              for(i=1; i <= m; ++i) {
                   // iterate until we find duplicate
                   theSet.add(new Long(curr));
                   curr = recurrence(curr);
                   if(theSet.contains(new Long(curr))) {
                        cut = true;
                        break;
                   System.out.println("X[" + i + "]: " + curr + "\n");
              if(cut) {
                   System.out.println("Cycle found: the next will come " + curr + "\n");
              } else {
                   System.out.println("No cycle found!");
              System.out.println("----------------------------------");
              System.out.println("Totally " + (i-1) + " iterations");
         private static long recurrence(long previous)
              return (a*previous + b)%m;
         static class LongComparator implements Comparator
              public int compare(Object o1, Object o2)
                   if(((Long)o1).longValue() < ((Long)o2).longValue()) {
                        return -1;
                   } else if(((Long)o1).longValue() > ((Long)o2).longValue()) {
                        return 1;
                   } else return 0;
    }

  • Help needed Urgently- Rebate based on collected amount

    Dear all,
    I come across scenario while discussiion with client that they require rebate with collection. Details of the requirement are given below:
    1. SAP rebates run on billed values & set the accrual in rebate agreement on the rate what we have specified in the rebate agreement. Requirement is that, If i have billed on 1000$ & my accrual value is 100$ with the rate of 10%. If i collected 800$ instead of 1000$, then i need to pay the accrual on the basis of 800$ not on the basis of 1000$. It means i have to adjust accrual amount on the basis of 800$. Conclusion is that i have to pay not 100$ accrual instead less then 100$ on the basis of 800$ which i collected.
    2. In month 1 have billed on 5000$, my accrual amount is 500$ with rate of 10%. In the 2nd month i have to bill 1000$ and i have given an discount of 500$, it means my billed value is 500$ and my accrual amount is 50$@10%. In month 3 again i billed 500$ and my accrual amount is 50$@10%.
    Requirement is that, when i am going to pay the accrual to client, i should pay correct accrual for which he is entitled for. Means i should pay 100$ accrual not 600$ because i have already given an discount of 500$. Discount which i have given already of 500$ should need to be offest with the first month accrual of 500$. So remaning accrual is 100$.
    Great if somebody can help me out for the solutioning of the above requirements.

    Thanks Ivano,
    Somebody has started the conversation.
    Let me put my questions again.
    This requirement is nothing to do with Payment procedure in the agreement type.
    1. In any month if i billed 1000$, so my account receivable would be 1000$. My rebate for that month is 100$ at the rate of 10%. During customer receipt if i collected against my invoice 900$ instead of 1000$, my accrual needs to be corrected 90$ instead of 100$.
    I know this can not be fullfilled by standard SAP, by any thoughts on this welcomed.
    2. I know Rebate can be settled partially or full settlement by payment method( by cheque, bank transfer, or by credit memo) we have configure in rebate agreement type. But here requirement is totally different.
    Here, i need to pay the Rebate as a Discount instead of by cheque or by credit memo. While doing the partial or full settlement system will take into account collected accrual up to that day & apply as a discount to the final bill.
    Scenario is like that sometimes customer asked to give us the discount on bill for whatever they accrued so far.
    This is again cannot solved by standard SAP, but any thought by any body welcome. We have already thought that we need to enhance the solution.
    Solution needed urgently.

  • Help needed please.. how do I remove my credit card from itunes? just discovered over $450 of charges when I looked at my email... Kids had no clue they were using our money and not their gift cards

    Help needed please.... I just discovered over $450 charges to my credit card from Itunes. The kids had no idea they were using our credit card and not their itunes gift cards and 4 year old just clicks on anything! I didnt save my credit card details so am a bit miffed at this... I cant find anywhere in itunes to remove it. Edit.. but not remove. Editing does not remove it.. HELP

    To Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact
    Accepted forms of payment  >  http://support.apple.com/kb/HT5552
    Changing Account Information  >  http://support.apple.com/kb/HT1918

  • Unable to allocate 27160 bytes.........Help needed urgently

    hi
    in my production database in getting this error..
    ORA-04031: unable to allocate 27160 bytes of shared memory ("shared
    pool","unknown object","sga heap(1,0)","session param values")
    help needed urgently

    If you have a program that does not use bind variables you can get this error.
    In such cases you do not want to increase the size of the shared pool, but reduce it, and flush regularly. This is a bug in the application and should be fixed to use bind variables.
    Another possible workaround is setting cursor_sharing = force, but this can cause other problems, so should only be used as a last resort. If the apps connections can be distinguished by user account or machine, then a log on trigger could be set cursor_sharing just for that application, to limit the damage until the vendor can fix it.

  • Need to know how to save printed image settings

    Photo printing setups; when printing a picture you have to make the following settings;
    (1) Select printer.
    (2) Printer Settings.
    (3) Select paper size.
    (4) Select Type of Prints.
    (5) Select print size.
    After doing this printing a draft copy or coming back a few day later wanting another copy printed.
    You go to edit load the file for picture to print, select create and you have to redefine the print all over again, this even after printing a draft copy and its OK and want to print 10 copies, you have to go back to Create and completely reset up to duplicate the draft picture you just printed.
    When save an edited and formatted picture all that is saved is the edited and format digital image file.
    I may want to print the image different sizes, on different types of paper, but Photo Shop doesn’t allow save the printed image files setup perimeter’s and tying the different print image setup to image file.
    So I have to maintain a file folder Excel files that list all the setup parameter’s need to print that uses this the image file as is primary image.
    Have I missed a Photo Shop function, that does this? 

    I thank everyone for the inputs, most if not all has been helpful.  If for no other reason than I am not used to this type photo printing. When most printing I did over my career has been mostly l technical drawings and there most if not all, were black and white and if you got the size printed right it was fine and nobody noticed.  But, now that I have retired I have more problems than before as I am now working more in not just color, but Photo graphs.  Then of course there is the ten years of technology I messed.  How I wish for the days when a program didn’t do what you wanted it too, you write your own code to add the function.  But, now security walls and the complexity of programs today you need a team of 10 programmers’ to do that.
      But, this not being able to sale the values of that print size, let alone color/shading, type paper, manufacture of paper and last but not lest printer and even its model. All of those effect color/shading of a print.  Just to day I have learned that the Application Program, OS driver and the printer can have color correction processingbuilt-n.  It’s no wonder what is on the screen doesn’t match what is printed.  And most of these color “correction” routines can't be enabled and disabled.  It is no wonder printing for one computer running the same Application and printing to two printers on that computer the prints are totally different.  At least now I know about them and know that every time I print the same image file I am go to have start all over  and work up all new printing parameters.  Use to be editing and formatting the image was 80% of the work, now it 20% of the work and printing is 80% of the work.

  • How to crop an image in Page?

    How can I ACTUALLY crop an image in Pages to the size of the mask? Reducing image size des not work, it reduces the size of all images by reducing the quality. It does not in fact cut images to the mask shape. Any ideas?

    When using the mask you get the images put behind the mask. You can change the size of the mask if you like to get the part of the image you want showing. That is the masks behavior.
    If you really want to crop the image first you have to use another application for the cropping. There are many out on the net that you can try.
    Download the Pages User Guide from your Pages Help menu. On page 138 in the English version it describes Masking images.

  • How to crop an image/audio file

    i have a component where in i need to crop an image and simultaneously crop the audio file.Is there a way to do that? Can anyone help me with it?

    I'm looking for the same thing.
    An audio file recorded by logic audio (AIFC, not AIFF, if this makes a difference) can be transposed non destructively in the arrange window (without the time machine) by checking "follow" in the arrange window, you can adjust the transposition from -12 to +12.
    When you do this, a double arrow icon is added to the audio region in the arrange window (like in this example : http://img140.imageshack.us/img140/6530/image17dp1.jpg)
    I can't find the way do this with a regular aiff file (non recorded via logic, I mean).
      Mac OS X (10.4.5)  

Maybe you are looking for

  • Problems sending email using javax.mail.*

    I need to send an email from an application I am working on. I am using the features of the javax.mail package to do so. In looking at the code I am unsure why this is not working. This is my first time using this package so it might be something sil

  • Cs5 photoshop refund edge is bluring

    cs5 photoshop refund edge is bluring. i did a fresch install of lion on osx and fresch install of cs5 and now the refind edge in photoshop make my pictures blurring. I delete fonts, delete brusches but still the refind edge make my pictures bad.

  • Fetch records from ETL Load control tables in BODS

    Hi, Please anyone tell me, how to fetch the records from the ETL Load control tables in BODS. (E.g) ETL_BATCH, ETL_JOB, ETL_DATAFLOW, ETL_RECON, ETL_ERROR. These are some ETL load tables.. Thanks, Ragrds, Ranjith.

  • Change UIComponent from fixed width to fit content

    I have a custom alert box I wrote. It has an optional second button. I use the alert box in various ways which may or may not need the second button. Previously I was creating and adding the button dynamically, but because flash is so slow I have to

  • Audio won't play after audio render

    I have an MP3 on audio track 1 in Premiere/CS4, placed underneath video clips which I've unlinked from the audio and deleted/cleared those unlinked audio files.  The MP3 file plays fine until I render the timeline and then it stops playing.  If I 'do