How to draw a rectangle so that she understands a rectangle rotated?

Did I miss an easy way to draw a rectangle around a rotated object?

The following code gives me the interim result in the illustration below, but I want the blue rectangle instead.

var w:uint      = image.width * image.scaleX;
var h:uint      = image.height * image.scaleY;

canvas.graphics.clear();canvas.graphics.beginFill(0xff0000, .6);
canvas.graphics.drawRect(image.x, image.y, w, h);

I thought that maybe do an image.right - image.left might work, but I can't seem to figure out how to get to work. How would I want draw the blue rectangle?  Thank you!

rotated-example.jpg

If you rotate an object, I think its transform.pixelBounds

change.

Tags: Flex

Similar Questions

  • How to draw a rectangle empty?

    How to draw a rectangle empty?

    I tried to create a title and use the rectangle tool. However, it doesn't let me do an empty rectangle... only a solid. Help please!

    Turn off the fill, select a feature, select the stroke color.

  • How to draw a rectangle with a border change according to a border image?

    Hi, I already walk image on a photo. Now I want to draw a rectangle at the end of the walk, but the border of the rectangle and border on foot to meet another eact perfectly.

    example image I gave below (downloaded from the internet). I want to fix this rectangle at the end of the foot.

    Thanks in advance

    https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcQRMYcCcxX5sC9jv8AUS64LSfb8I7K6GSsKCsCrUCOE1tbQ6f-Phttps://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRSj_yAwQWXik-xB-spAi9gZwUSgz6JkPCgpGmdajCrY0h6P0hGnw

    Nice day!

    Could you please post a screenshot with the Panel visible layers?

    Is the iten by chance one layer shape and therefore does not have a vector mask?

    Kind regards

    Pfaffenbichler

  • How to draw a rectangle that is a dimension specific?

    I want to be able to draw rectangles that are specific sizes in Photoshop. I know in Illustrator, you can select the brand tool, click in your document and get a dialog box that allows you to enter the exact size that you want your site to be. You can do in Photoshop CS4?

    Just click on the little arrow pointing down

  • How to draw and animate like that to the PS CS6

    Hey, the owner of the video told me that he did with the ps all the animation, a tutorial that I want to learn about:
    Gear 4 (Fan Animation) / Deutsch - YouTube

    The characters are manga.

    Plenty of tutorials on Photoshop animation appear when search you the Web. Here are a few. The top one is for CS6, and others are for later versions.

    Hamilton shoots Episode 5: Animation in Photoshop CS6 - YouTube

    Create image animations in Photoshop

    Create Animations in Photoshop

    Animation of Photoshop techniques - Alex Grigg

  • How a listener function can broadcast that she has completed the

    I have a listener function that is running on ENTER_FRAME, but I want two other methods to follow when this function is finished. If I call these methods after the removeEventListener which is inside the listener, it works, but then I can't
    access variables that have changed inside these methods. I need to create a custom event?

    No, pass an object that has an onComplete property that is a function defined in your fla. something like:

  • How to draw a smooth line (small in some places, in others) like in this picture

    intaward.jpg

    Check the image I attached above. I need to design a different logo. But to draw like this because the two logos will be placed together (they must match). So someone knows how to draw the smooth line that is low in some places and large in others? How to add this effect? IM using Illustrator CS5.

    He number of ways yu area can make a brush with a thick and thin profile, or create a profile for a stroke, or you can draw paths with even simple traits and then survive strokes and adjust the width then

    or you can draw paths with even stroke and the use of the width tool to adjust the widths.

    It is with the paths with the same shots

    Here, after I used the width tool to adjust the width of the strokes

  • How could draw you a border around a rectangle in Flex?

    I need to know how to draw a border gray around a rectangle using MXML, without having to fill the rectangle with any color. I also need to know how to design the screen so that the components (in this case, I have a few fields of text entry, a button and a check box) appear in the rectangle. The rectangle should not take up the full width or height of the screen.

    Use of a group. Set the width and height to any size. Inside, the group uses a Rect with the width and height of 100%. Give him a stroke.

    Example:

    2

    2

    2

    2

    2

    2

    2

    2

    If this color value does not use 0xffffff

    If this color value does not use 0x000000

  • I can't my auto signature to look how I want that she keeps returning to the text without spaces

    I can't my auto signature to look how I want that she keeps returning to the text without spaces

    Put

    < br >

    everywhere, you want a line break.

    for example

    My phone number is 01937 534183 if you wish to discuss. < br >
    < br >
    Thank you, < br >
    < br >
    Oliver

  • My wife and I bought hundreds of iTunes movies and music over the years. I have a terminal illness and won't last long. The account is in my name. How can I ensure that films and the songs that she and I have paid for are accessible for her after I spend

    My wife and I bought hundreds of iTunes movies and music over the years. I have a terminal illness and won't last long. The account is in my name. How can I ensure that films and the songs that she and I have paid for are accessible for her after I die?

    She needs to have your Apple ID and password. Your iCloud ID and the password if you have your own iOS device, so it can have access to these facilities. Even if she wanted to sell, it would need this information to remove the lock of activation before the sale.

  • My e-mail account tells me that she is blocked. How to fix this?

    Help, please.

    My e-mail account tells me that she is blocked.  How to fix this?

    Also, when I use my security question he always says that my copy is bad.

    Thank you!

    Are we to guess what email program you use? Maybe it's one of them?

    View all Windows Live and Hotmail questions in the appropriate forum found here:
    http://windowslivehelp.com/

  • How can I make the image that is within the rectangle to move?

    Hi, I'm doing a Web page with muse and I found the Coffee pastries Katie page. There are some pictures in the home pages this movement inside the form when I scroll the page. Could someone please tell me that how can I make the image that is within the rectangle to move?  Thank you very much

    You can apply the scroll to fill the picture or the rectangle itself if you are referring to scrolling rectangle on the page.

    https://helpx.Adobe.com/Muse/using/scroll-effects.html

    https://helpx.Adobe.com/Muse/how-to/explore-new-scroll-effects.html

    https://helpx.Adobe.com/Muse/using/applying-scroll-effects-browser-fills.html

    Thank you

    Sanjit

  • How can I draw a rectangle?

    I need to simulate a drawing of a rectangle with the Rectangle tool in a script. One way is to use the earpiece of Script and modify the code, so I can pass the necessary variables. Is there a better solution? Thank you.

    You can draw a rectangle as follows.

    #target photoshop;
    app.bringToFront();
    
    main();
    function main(){
    try{
    app.displayDialogs = DialogModes.NO;
    var strtRulerUnits = app.preferences.rulerUnits;
    var strtTypeUnits = app.preferences.typeUnits;
    app.preferences.rulerUnits = Units.PIXELS;
    app.preferences.typeUnits = TypeUnits.PIXELS;
    var Colour = new SolidColor;
    Colour.rgb.hexValue = 'ff00ff';
    app.documents.add();
    activeDocument.selection.select([[10, 10], [494, 10], [494, 350], [10,350]], SelectionType.REPLACE, 0, false);
    activeDocument.selection.stroke (Colour, 4, StrokeLocation.INSIDE,ColorBlendMode.NORMAL,100);
    activeDocument.selection.deselect();
    }catch(e){}
    finally{
    app.preferences.rulerUnits = strtRulerUnits;
    app.preferences.typeUnits = strtTypeUnits;
    };
    };
    
  • Draw a rectangle in a graph

    Hi, I want to programmatically draw a rectangle on a chart XY (XY Graph.vi Build). I know where the 4 points are on the coordinate chart but I can't yet draw using the block Rectangle to draw. Could you please help me how can I draw a rectangle in a graph. I am attaching the photo to this message

    Hi guys,.

    I thought it was interesting questions - and, although I had not tried anything quite like this before, I thought I would give it a whirl. smercurio_fcsuggestion was excellent - I find the code referenced in LV example finder, in the fundermentals > graphics & graphics > plot pictures folder.

    Attached are 2 pieces of code.

    DrawRectangle on Graph.vi allows users to define the rectangle by cluster of façade.

    DrawRectangle on graphic .vi (events) allows the user to define the rectangle by clicking and dragging on the chart. Please note that the code requires that you start from the upper left corner of the rectangle, and drag to the lower right. But isn't that a creative logic would not solve - if you wanted a bit more flexible code.

    You should also know that I have not spent a lot of time on the code, so it is not perfectly architected. But we need to think!

    Best wishes

  • How to draw a box under a trace of waveform?

    Hi all

    I have a graph of waveform of 3000 point showing a series of peaks.  For one of these peaks, for which I know the beginning and end clues, I would draw a box under the waveform on the graph, to highlight its position programmatically.  I don't know if there is a way to do it.

    I figured out how to draw cursors at the beginning and at the end, but finally I do for multiple peaks, and forest of cursors quickly becomes confused.  A simple shaded box works much better.

    Any ideas?

    Many thanks in advance,

    RipRock99

    A great thank you GerdW!

    The code LV was very close to what I wanted to do and is easy to use to determine how to make my code produces the result I wanted.  Basically, I added another form of wave to my chart, using my known indices x to set the values of Y for the areas I wanted to be gray as + infinity and leaving the rest to =-infinity.  I then plotted this second graph on top of the original waveform and the property node to set the fill indicator for - infinite.

    That does not answer the general question of how to draw a filled rectangle with the coordinates on a graph, but this does not fix what I wanted to achieve.

    Bravo and thanks,

    RipRock99

    PS: I'm including a preview of the result and a snapshot of the code used to define the property node programmatically.  I do not understand my code just as it is complicated, and I would also need to add a large set of data.  I hope that the pictures are enough to help someone else referencing this Council!

Maybe you are looking for