Need to rotate image around the axis

Hi, I'm using this ti rotate the image, it works but I need to rotate the image around the center of the image, center axis.
I don't understad what is the meaning of values 50 and 60, and what I need to write instead?
public void paintComponent_new(Graphics g){
super.paintComponent(g);
Graphics2D g2 = (Graphics2D)g;
g2.rotate (Math.toRadians(angle),60,60);
g2.drawImage(pre.getImage(), 50, 50, this);
g2.dispose();
}

Using that method, the rotation occurs around the point (x,y). The rotation is a measure of theta radians. One radian translates to 180/PI degrees; thus, there are 2*PI radians in 360 degrees.
So if, for example, you wanted to rotate round the point (40,40) exactly 90 degrees, you could use
Graphics2D g2d = ...;
g2d.rotate(Math.PI/2, 40, 40);Note that this rotation is a translation of the view, not a translation of any contents. That means that anything drawn to the Graphics2D object will appear as if rotated in that fashion. Therefore, if you draw an image onto that Graphics2D object after calling rotate in that fashion, the image will be rotated as well.

Similar Messages

  • I need to download image from the url and the image is in byte format.

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

    hi
    i need to download image from the url
    http://www.tidelinesonline.com/mobile/j2me_v1?reqType=imageJoin&imageCount=1&month=1&day=1&year=2008&id=1&imageWidth=230&imageHeight=216&imageDepth=8&imageUnits=feet&imageType=JPG&msisdn=456
    first 5 digits will be its length,we need to download except 5 digits.
    can any one know how to do that.
    thanks in advance
    Mraj

  • How to always rotate objects around the same point, even using the right-click menu?

    I need some of my objects to always rotate around the same point. How can I select a point which will stay that way?
    Using the rotate tool resets after deselecting.
    Also, I'd like to rotate objects around a certain point even when using the right click > Transform > Rotate.
    Is it possible?

    Right, so this is where Illustrator falls short with respect you your need, but only in the sense that the reference point can't be made to stick. You can, however, use Smart Guides to make it so the point is easy to set at exactly the same location, (especially since your object has an anchor point there), manually before each rotation.

  • Need text and image in the message

    Hi,
    I need to send an email with an image and text as part of the message, Ill do the following but it jsut takes the text and as an attachment, how can I include both content in the body of message??
    BodyPart texto = new MimeBodyPart();
    texto.setContent(fichero, "text/html");
    multipart.addBodyPart(texto);
    // Procesar la imagen
    MimeBodyPart imagen = new MimeBodyPart();
    imagen.attachFile("C:/Documents and Settings/Administrador/Mis documentos/Sandra/epinuevo/web/imagenes/logo150px.jpg");
    imagen.setHeader("Content-ID", "<figura1>");
    MimeBodyPart imagen1 = new MimeBodyPart();
    imagen1.setText("Sandra");//.attachFile("C:/Documents and Settings/Administrador/Mis documentos/Sandra/epinuevo/web/imagenes/logo150px.jpg");
    imagen1.setHeader("Content-ID", "<nombre>");
    multipart.addBodyPart(imagen1);
    message.setContent(multipart);
    Thanks!!

    Milene wrote:
    bshannon wrote:
    If you're still having trouble, you can find a message created by some other
    program that has the overall structure you want, and then copy its structure.I dont understand what do u mean exactly.You want your message to look and behave a certain way.
    Find another message (with different content), that looks and behaves similarly to what
    you want. Perhaps you can create such a message using another mailer. Or perhaps
    you've received a message from someone else that is similar to what you're trying to do.
    Then, look at that message using the "view source" function of your mailer. You'll see all
    the MIME headers, etc. You can then use a similar MIME structure in your message.
    You'll also see the content of the body parts and how the content references images and
    URLs. Use a similar technique in your message.
    But I was trying to include the image and the text as 2 different MimeBodyPart, now I found a simple solution I add html code as part of the message where there is a reference to the image, all the text in in the code.
    But now I have a problem cause I have in that html code an URL as an > but when i recieve the mail the url doesnt work, is there any other funciont to add urls in a special way???
    A URL reference like "xxxx.jsp" is implicitly relative to the html page containing the reference.
    When you include the html content in a mail message, the reference is relative to the mail
    message. That's not what you want. You want the reference to point to your web site. The
    simplest solution is to just use a reference like "http://myserver/myurl/xxxxx.jsp".
    Note that viewing html in a mail message is not exactly the same as viewing html on a web
    page. Different mailers will impose different restrictions on what you can do in the html in a
    mail message.

  • Please help...Need to rotate image/MC by moving mouse

    Hi all,
    I'm sure a lot of you have seen the tutorials for buttonless
    scrolling (where you move your cursor to the right of the screen
    and the movieclip scrolls to the left etc). Here is an excellent
    example...
    http://www.gotoandlearn.com/
    (and then scroll down until you get to the title, 'Scrolling
    Thumbnail Panel'.
    Now, I want to use this principle to rotate a MC of the world
    instead of scrolling the MC left and right. So, as your cursor
    moves to the right of the screen, the globe rotates in an
    anti-clockwise direction and visa versa.
    Could anyone help moderate the code below (or provide new
    code) to make this work? I've tried a few things but none of them
    work. Thanks!! (Really need this for campaign at work!! Panicking a
    bit).
    FG.
    the code...
    panel.onRollOver = panelOver;
    function panelOver() {
    this.onEnterFrame = scrollPanel;
    delete this.onRollOver;
    var b = stroke.getBounds(_root);
    function scrollPanel() {
    if(_xmouse<b.xMin || _xmouse>b.xMax ||
    _ymouse<b.yMin || _ymouse>b.yMax) {
    this.onRollOver = panelOver;
    delete this.onEnterFrame;
    if(panel._x >= 89) {
    panel._x = 89;
    if(panel._x <= -751) {
    panel._x = -751;
    var xdist = _xmouse - 250;
    panel._x += Math.round(-xdist / 7);
    }

    OK, I've got a script that is a lot easier and DOES rotate
    the m/c! It's:
    var mouseList:Object = {};
    Mouse.addListener(mouseList);
    mouseList.onMouseMove = function(){
    worldMC._rotation = _xmouse;
    But it stops when my cursor does. In the scrolling example,
    the further right your cursor goes, the more the horizontal MC
    scrolls. Only when the cursor is in the centre of the screen does
    the globe stop rotating.
    So what I really need here is a globe that starts to rotate
    anti-clockwise when the cursor is moved to the right...the further
    right it goes, the faster it rotates. When the cursor moves to a
    central location, the speed of the globe's rotation slows to a stop
    (allowing the user to click onto a point on the globe).
    If you've given the example I linked to above a go, this
    should be a little clearer. It's hard to put into writing, but I
    hope you get the idea. Looking forward to hearing from you.
    FG.

  • Keep rotate image on the top left of my panel.

    Hi,
    Does anyone know how to rotate an image but keep the image to the left upper corner of the panel? I am using affineTransform to perform rotation.
    Thanks.

    What's the problem exactly, does the image move from it's location? Does it not redraw properly? Please be more specific.
    Cheers.

  • How do i rotate images in the Book feature?

    I run Aperture 3.4.4 and want to know if i can rotate images when designing a book.  I looked through the archives and there are several notes that say if i mouseover the upper left corner of a selected image in Edit Layout mode i will get crosshairs.   This does not happen in my version.  Any suggestions?

    You could try to change the "angle" in the "Edit Layout" view in the Size & Position options.
    To show the "Size&Position" layout options use the cogwheel below the Pages browser.
    Regards
    Léonie

  • Using Javascript to rotate images with the style.backgroundImage property & I leave the onload pg & return, the images have trouble loading.

    I'm using Javascript to rotate background images -->
    function rotateImages() {
    setInterval("startRotator()", 7000);
    var counter = 0;
    function startRotator() {
    var images = ["images/finance1.jpg","images/finance2.jpg","images/finance3.jpg","images/finance4.jpg","images/finance5.jpg","images/finance6.jpg"];
    if( counter >= images.length ) {
    counter = 0;
    var image = "url('" + images[counter] + "')";
    counter++;
    document.body.style.backgroundImage=image;
    The script is triggered by the load event when the homepage loads and the script only runs on the homepage. Everything works fine upon opening the homepage.
    If I leave the home page and return, the images will have trouble loading for about 3 to 5 cycles and I'll get white backgrounds for part of the time. The same thing happens if I enter the site from a page other than the homepage and then go to the homepage.
    I discovered, however, that if I enter the site at the homepage and then leave the homepage and return using the back button, everything runs fine. Apparently it then accesses a cached version of the homepage? Seems having two cached versions creates a conflict?
    This problem only happens with Firefox (I have ver 29.0.1). It does not happen on IE ver 11, Chrome ver 34, or Safari ver 5.1.7.
    I get the same problem with XP, Win7, and Win8 but, only on Firefox.
    Can you please fix this?

    Hey, I am trying to reproduce this here: [http://jsfiddle.net/u3TLb/]
    Mozillazine forums and the [http://webcompat.com] are more specialized in Web Compatibility, please ask there as well.

  • I have Lightroom 5. How do I rotate images in the development module?

    The heading says it all...

    Well actually, it doesn't say it all
    Do you mean rotate a few degrees to get the horizon level, or 90 degrees because the camera or software didn't properly recognize the photo was either landscape or portrait, or 180 degrees; or change from landscape to portrait without rotating 90 degrees; or what?

  • Image quality when moving bitmaps around the stage

    Hey all,
    I am moving an image around the stage, and when it moves
    quickly, it becomes distorted and displays what I can only refer to
    as "banding". The image appear to be misaligned for some of the
    frames that it is moving. I have tried a number of the usual fixes,
    increasing the framerate, using a less complex image, etc. Nothing
    seems to work. Any ideas? I feel like I have seen a lot of flash +
    director movies that have fast motion, slick movement, etc and not
    appear as what I end up with. Is this something that relates to a
    screen refresh rate? Thanks for any ideas...
    - B

    Sounds like good old vertical sync / tearing. This is really
    not a fixable
    issue. You can try slowing down the movement a little...
    Someone, a while
    ago, worked on creating an xtra that would honor the vertical
    blanking
    interval, but it never really worked properly I don't
    believe. You can read
    all kinds of prior posts about this by searching google
    groups within
    macromedia.director.* for 'vertical sync'
    Dave -
    Head Developer
    www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How do you change the axis of an object?

    I'm trying to make a rotating image on the corner of my screen, but the only axis it rotates around (trying to do an x axis rotation) seems to be in the corner of the image. Can i change it so it rotates around the middle?
    Thanks

    Right-click the object, choose the Anchor Point tool, move the anchor point (which is the point around which an object scales and rotates), then switch back to your selection tool (right-click again or Shift-S).

  • Photoshop CS3 will not auto-rotate images...

    After loading CS3 on my new MacBook Pro (3.06 Ghz Intel Core 2 Duo), Photoshop does not auto rotate images?
    The finder rotates them...Bridge rotates them...Expression Media2 rotates them.....Photoshop does not
    Obviously the camera, Nikon D2x, is set to tag vertical images for rotation. What gives? I can't find any sort of setting in PS for auto rotate.
    It worked on my old laptop and on an old EMac.

    Thanks! I appreciated the help. But I did that also.
    It is a waste of my time to have to do this after every photo shoot. Photoshop and many other programs do this automatically. There has to be a reason for it not working on my new laptop. I even uninstalled and reinstalled CS3.
    I was hoping for a solution not a work around....I guess I need to contact the Adobe support team. Do they frequent these forums or is it just us?

  • Rotating images in separate htm document (DW CS4)

    Hi all,
    A few questions:
    1. I created a rotating images htm document by using the swap image function and then changing the code a bit (found this on internet). This works just fine on my PC (LiveView) and the htm document is switching between 3 images. I have placed the document in the images folder. However, when uploaded it doesnt work:
    http://www.competenciagroup.com/images/RotatingImages.htm
    2. If i get this htm document to work on the net I would like to input the htm document with the rotating images into the heading of my main document:
    http://www.competenciagroup.com/ColombiaTravel/index.html
    (just above the menu)
    I could not though figure out how to input the htm document into the existing html document.
    Anybody have any clue on the 2 questions above?
    Thanks in advance,
    Ingvar Malde

    I know plenty of people run into the issue of not being able to see their images while in design view, but mine is the exact opposite.
    My images show up as a tiny blue question mark box in Live View... As well as when I preview it in a browser localy on my machine.
    I think I know why it might be happening but dont know how to fix it...
    When I insert an image DW codes it as such:
    <img src="/images/madintro.jpg" width="470" height="267" />
    The problem seems to lie in DW adding the "/" in front of "images"
    when I manually go in and take out the "/" the image shows magically shows up as it should.
    Why has dreamweaver suddenly defaulted to making bad code? what did I do to cause this issue? And obviously how can I change it back to work again and make the image show in my DW workspace?
    Yes, the slash is exactly the problem. That is known as a Site-root relative link.These types of link are good to use in Templates because they are always the same. They don't need to be "fixed' when you generate a page from your Template into a different folder.
    The downside of using Site-root reltive links, is that you can't access the files locally. You must get the page from a web server. One exception to that is using Preview in Browser (PIB) "Temp" files.
    Read this Tech Note about setting up a Testing Server so you can see these files in Live View and PIB:
    http://blogs.adobe.com/dreamweaver/2008/12/live_view_and_siteroot_relativ.html
    If you want to switch back to using Document relative links, then setthe Relative to: field to be "Document" in the "Browse for file" dialog (folder button next to Link field in PI). This setting is sticky, so all future link will use the same setting.
    Hope this helps,
    Randy

  • Rotated Images

    When I download a picture to Desktop it transfers the picture to a folder called Rotated Images no matter which ISP I am using. It also happen if I drop an image /picture onto the desktop: it sits there apx 3 seconds then creates a Rotated Images folder & the picture is there rotated 90 degrees.
    I have tried deleting the folder to Trash, emptying the Trash, and Restart. Same thing happens. Although there is no Rotated Images folder on the Desktop, as soon as I drop any image on the Desktop it creates an Rotated Images folder and the picture goes in there and rotates 90 degrees. It seemed to suddenly start. I don't believe I installed any app that would cause it to happen (I hadn't installed an app at the time it started).
    I don't know if it was 'spammed' to my iMac -possibly?
    When I use Spotlight it doesn't find Rotated Images except for the newly created folder on the Desktop.
    Has anyone encountered this problem? Has anyone found a solution? It is confusing and annoying. I have to add it to iPhoto then rotate it and Revert to Original rotates back.
    The work/around is to Rotate & Save in Photoshop, then Import to iPhoto. Bummer.
    Thank you.

    I meant to ask: Has anyone encountered this problem? Has anyone found a solution? It is confusing and annoying. I have to add it to iPhoto then rotate it and Revert to Original rotates back.
    The work/around is to Rotate & Save in Photoshop, then Import to iPhoto. Bummer.
    Thank you.

  • Display Image from the database but prevent it from refreshing on every pages

    Hi there,
    I can see there are many discussions around this but my query is slightly different. I'm writing this on behalf of one of my developers. (sorry for my ignorance on techie stuff.. :-))
    A logo is being displayed on a few pages, which is called from the database. However, the problem is that  - this logo refreshes every time when you traverse to each page causing a performance issue or sometimes slow loading of the image.
    My question is - how do we stop it from loading on each page from the database?.  I would rather load once when the main page loads initially and then maintain this on other pages too.
    We can keep this logo on a file system (FS)  and display it via CSS/HTML/frame but since we want to keep it flexible/dynamic where a user can upload a new one whenever it changes and hence DB seems to be the suitable option (in my opinion).
    Can someone please help?
    If you need any further info around the coding how it is being done at present, pls let me know.
    Thank you

    read this http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm#g1017777
    you can cache lobs in the database too
    you can also upload the pic in your file system using utl_file package and then put the image in the working directory mentioned in i.war
    you can then reference the image and it will not be stored in the database and will be cached
    Regards,
    Vishal
    Oracle APEX 4.2 Reporting | Packt Publishing
    Vishal's blog

Maybe you are looking for

  • Printing "to do" list

    How do you prevent iCal from printing to do items that are "done"? I really don't need to sift through 20 pages of crap looking at things I already did. I don't want to delete these done items either as I've got notes, attachments,and url's associate

  • After Effect errors with GeForce GTX 860M !!

    Hello everybody, I have tried the trial version of After Effect on my brand new laptop MSI GE70-2PE048FR with Nvidia GeForce GTX 860M CUDA v6 - Mobile QuadCore Intel Core i7-4700HQ, 3300 MHz (33 x 100) and Im getting errors while trying to render a t

  • Spotlight won't open open in Yosemite

    I keep getting the "In addition to searching your Mac, Spotlight now shows suggestions from the Internet, iTunes, App Store, movie showtimes, locations nearby" message. How do I get back to being able to use Spotlight? Thanks

  • Edit Show Pop-Up Menu

    I'm using Dreamweaver's Show Pop-Up Menu Behavior. I have a sample drop down of 3 links. I'd like to give each of the drop down cell's a unique rollover color. Can this be done somehow? If so, what javascript do I have to edit?

  • Emac osx problem, blank home page, missing icons.

    Hello.   I am having trouble with my 2005 or 2006 (cant quite remeber) emac osx.  I get through the login portion and it then brings me to the home screen except their are no icons visable.  I also tried turning it on by holding done the option butto