Rectangle to parallelogram

Am used to corel draw for designing but am new to adobe illustrator.  In corel draw rectangular object when move my pointer in outer renctangle right or left side of the object ill get arrow key in bottom n top direction for making rectangle in parallelogram. Kindly help me in illustrator for such tools. I need to use this tool in illustrator. please check the used in corel draw below.

Select 'E' on your keyboard and you will get the right tool you need.
With this tool selected select the centre top point of your rectangle and hold shift and drag the way you want it.

Similar Messages

  • Need help in this design, SHAPES!

    Hello everyone.
    I have a simple programming project but I'm getting caught up on what should be the super class.
    Its shapes.
    I have the following:
    A Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square.
    At first I had it designed like
    Quadrilateral is the super class of all the other shapes which I'm now seeing isn't the case.
    A rectangle and Square is a special type of Parallelogram so my rectangle and square class is going to extend from the Parallelogram class.
    Now would the Parallelogram class extend from the Trapezoid class and the Trapezoid class extend from the Quadralterial class?
    Is that how the class diagram should look like?
    THanks!

    I see what your saying.
    Well the instructions are the following:
    9.8 Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram,
    Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral should be the x-y coordinate pairs for the four endpoints of the Quadrilateral. Write a program that instantiates objects of your classes and outputs each object�s area (except Quadrilateral). The coordinates for the quadrilaterals are specified in an order that will produce a quadrilateral when drawn in the order given. You should use good software engineering principles, as practiced in Java, when developing this program. For example, you should use set and get methods in each class for accessing private instance data. There should be one additional class specified which is the Point class. The Point class consists of two values of private data, the x coordinate of the Point and the y coordinate of the Point.
    Use the following as the definition of the main class QuadrilateralTest:
    * Main.java
    * Created on August 31, 2007, 1:39 AM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package quadrilateraltest;
    * @author Al
    public class Main {
        /** Creates a new instance of Main */
        public Main() {
         * @param args the command line arguments
        public static void main(String[] args) {
            // TODO code application logic here
            Quadrilateral quadrilateral = new Quadrilateral(1.1, 1.2, 6.6, 2.8, 6.6, 9.9, 2.2, 7.4);
            Trapezoid trapezoid = new Trapezoid(0.0, 0.0, 10.0, 0.0, 8.0, 5.0, 3.3, 5.0);
            Parallelogram parallelogram = new Parallelogram( 5.0, 5.0, 11.0, 5.0, 12.0, 20.0, 6.0, 20.0 );
            Rectangle rectangle = new Rectangle( 17.0, 14.0, 30.0, 14.0, 30.0, 28.0, 17.0, 28.0 );
            Square square = new Square( 4.0, 0.0, 8.0, 0.0, 8.0, 4.0, 4.0, 4.0 );
            System.out.printf("%s %s %s %s %s\n", quadrilateral, trapezoid, parallelogram, rectangle, square );
    The results produced by the program should look similar to the following:
    Coordinates of Quadrilateral are:
    (1.1, 1.2), (6.6, 2.8), (6.6, 9.9), (2.2, 7.4)
    Coordinates of Trapezoid are:
    (0.0, 0.0), (10.0, 0.0), (8.0, 5.0), (3.3, 5.0)
    Height is: 5.0
    Area is: 36.75
    Coordinates of Parallelogram are:
    (5.0, 5.0), (11.0, 5.0), (12.0, 20.0), (6.0, 20.0)
    Width is: 6.0
    Height is: 15.0
    Area is: 90.0
    Coordinates of Rectangle are:
    (17.0, 14.0), (30.0, 14.0), (30.0, 28.0), (17.0, 28.0)
    Width is: 13.0
    Height is: 14.0
    Area is: 182.0
    Coordinates of Square are:
    (4.0, 0.0), (8.0, 0.0), (8.0, 4.0), (4.0, 4.0)
    Side is: 4.0
    Area is: 16.0
    The way he worded it sounded like he really wants to use inheritance to the max, so thats why I set it up like that.
    * Rectangle.java
    * Created on January 24, 2008, 1:51 PM
    * To change this template, choose Tools | Template Manager
    * and open the template in the editor.
    package quadrilateraltest;
    * @author Mr. Coffee
    public class Rectangle extends Parallelogram{
        /** Creates a new instance of Rectangle */
        public Rectangle(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4 )
             super(x1,y1,x2,y2,x3,y3,x4,y4);
        public double getArea()
            return (getWidth() * getHeight());
        public String toString()
            return ("\nCoordinates of Rectangle are: \n"+
                    getPoint1() +"," + getPoint2() +"," + getPoint3() + "," + getPoint4() +
                    "\nWidth is: " + getWidth() + "\nHeight is: " + getHeight() + "\nArea is: " + getArea())+"\n";
    }Thats an example of how my code is working.

  • After migrating data from Time Machine, some of my photos are not showing up in iPhoto. I get a 'dashed rectangle." When I click on it I get ' ! in a Triangle" When I click on that, I actually can see the photo. I want to see my photos

    After migrating data from Time Machine, some of my photos are not showing up in iPhoto LIbrary view. I get a 'dashed rectangle." When I click on it I get ' ! in a Triangle" When I click on that, I actually can see the photo. I want to see all  my photos in 'Library' view, and I can't figure out how these photos seem to be arbitrarily hidden. Help, please.

    Try these for the first attempt:
    First be sure to have a backup copy of the library if you already don't have one.
    OT

  • Photoshop CC: When I'm trying to draw a rectangle I can't fill it or create a stoke because there is a message telling me; "Could not complete your request because of a program error. What can I do?

    Photoshop CC: When I'm trying to draw a rectangle I can't fill it or create a stoke because there is a message telling me; "Could not complete your request because of a program error. What can I do?

    It is a mute point now. PSE12 finally failed to the point it locked up the MAC. I had to restore the MAC OS from backup to a point before the PSE12 update.
    The MAC now operates correctly and so does PSE12. I don't think I'll be updating PSE any time soon.

  • Hello, i restored and updated my iphone 4 to the latest version of 5.1.1 and after that when i connect my mobile to i tunes all i see is a big rectangle and a apple logo on left and a small lock on right side please help me fix this problem.

    hello,
    i restored and updated my iphone 4 to the latest version of 5.1.1 and after that when i connect my mobile to i tunes all i see is a big rectangle and a apple logo on left and a small lock on right side please help me fix this problem.

    I sloved this issue by resting my phone from settings>general>reset>reset all settings...the problem will be fixed

  • How to pop up "Drag New signature rectangle" window from plug-in?

    Hi, everybody
           I am trying to create a menu that contains menuitem "sign". when the  user click on menu->"sign" a  window  pop-up
           asking for "Drag New signature rectangle" from the user.This window is same as poped up by default by digSig.
           Problem is Which API should be used to pop this window.
           Any kind of help will be welcomed.
                                                                                                                        Thanks and Regard

    Thanks soooooooooooooooooooooooooooooooooooooooo much!!!!!!!!!!!!!!!!!!!!!!!!! This is EXACTLY what I want to do!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! wuwuwuwuwuuwuwuw....................want to cry~~~~~~~~~~~~~~~~~thanks thanks~~~~~~~~~~~~~~~~~~~~~``

  • I have all my photos both in the photo library by date and as events . When I open I-photo in either format there are just empty rectangles with names. If I click the photo appears. This was not like this before. How can I get it back so that I can see th

    I have all my photos organized in i-photo as both photos and events. When I opened in the past the images in each event or album appeared as icons on the sreen. Now when I open I only get a dotted line rectangle and only if I click I see the picture, which is really problematic when trying to see or select nay image.
    I don't know if mistakenly I did something with the settings although I couls not find anything in preferences or any of the menus that could relate to this.

    Back up your iPhoto library, Depress and hold the option (alt) and command keys and launch iPhoto - rebuild your iPhoto thumbnails - this may take several tries
    Also what version of iPhoto? What recently changed?
    LN

  • Check if a point lies inside a rectangle

    Hi im making an application that displays a shape on the screen at different locations. The shape is a combination of an ellipse and a line. My problem is when i want to draw the shapes i created a method to check if the point given is contained by any other shape and if it is it should create a new point. However when the .contains(Point) method is run it doesnt reply true or false so my code just goes into an infinite loop and crashes.
    Here is the checkpoint method that loops infintly
    private void setPoint(Point pow) {
              boolean anythingthere = false;
              while (anythingthere==!true) {
                   Rectangle test = list.getBounds();
                   if (test.contains(pow)) {
                        int f = pow.x;
                        f = f+200;
                        int g = pow.y;
                        pow.setLocation(f, g);
                        System.out.println(pow);
                        f = 0;
                   else {
                        if (pow.x+150 > getWidth()) {
                             pow.setLocation(50, pow.y+180);
                        anythingthere = true;
                        i++;
         }And because my shape is a combination of graphics2D shapes i created this method in its class to return the rectangle that bounds the shapepublic Rectangle getBounds() {
         bound = new Rectangle(location.x,location.y,size,size);
         return bound;
    }Thanks for any help you can give im really stumped!!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Hi thanks for your reply's. Thanks for tips on making my code nicer and efficient ive tried to do it throughout my project so hopefully its more readable now. The problem was to do with scope like one of you said so i moved a few things round and got it working. The problem was when i called the bounds of the rectangle it was returning the bounds using the last changed point which meant that every time i tested the loop the point was inside that bound so it basically looped infinitely. One line moved and it worked perfectly.
    Thanks everyone

  • How to access a placed PDF inside a rectangle and move it around

    Hi, I have the following code which places a PDF inside a rectangle var f = new File("C:/pdf.pdf");    var doc = app.activeDocument;  var thepdf =doc.pages[0].rectangles[0].place(f, false);  doc.pages[0].rectangles[0].fit(FitOptions.FILL_PROPORTIONALLY);  Now I want to move "thepdf" (which is of object type PDF) but I can only find a way to move the rectangle around it. I need to move the inner rectangle (the PDF), like I would do with the Direct selection tool. is this possible?

    Yes. That's possible.
    The PDF placed inside the rectangle is the graphics[0] object of the rectangle.
    Or, if you look it up in the links collection, the parent of that link. The parent of that parent is the container object, the rectangle.
    myRectangle.graphics[0].move(/*insert your arguments here*/)
    Would move the PDF inside. Where the move() method could have different arguments:
    Adobe InDesign CS6 (8.0) Object Model JS: Graphic
    Uwe

  • Drawing lines, rectangles and circles as objects onto a JPanel.

    Hi. I have to complete a task in school. The work is to create some simple 2D graphical editor. I'm new to java and I have some problems with this job, so I'm looking for help where it is possible...
    I created a JFrame and using it as a window. Into this JFrame I've added a toolbox (JToolBox) and "drawpad" - a JPanel. The toolbox wasn't any problem, but I aim to use the JPanel for drawing 2D objects. I tought about creating some container of objects, where I could put lines, rectangles or circles, each one with its properties (color, [x; y] coordinates on the scene, filling and drawing width) and then, draw this scene onto the JPanel.
    It should be something like windows Paintbrush. Can be simplier, but including the possibility to move and change properties of drawn objects.

    Well, there are two approaches to this that come to mind:
    1. Create an image. If this program is supposed to be like Windows Paint, the tools you are describing are only there for the sake of modifying a two dimensional image. In that case, I would recommend using a BufferedImage.
    The JPanel can contain a single JLabel. The JLabel is constructed in the following fashion:
    JLabel image_label = new JLabel(new ImageIcon(bufferedImage));...where bufferedImage is the image on which you will be storing the data. You can use bufferedImage.getGraphics() to get an object which will quite happily draw geometric shapes for you. Then, after each draw, you tell the panel to repaint itself.
    2. Store the shapes and create a component to draw them for you. You'd create a new JComponent class that would accept objects representing geometric shapes. You then override the paintComponent method on this new class to have it render itself according to the contents of the geometry objects. It would also probably be advisable to have all of these classes implement a common interface (which you would also create) so the rendering component could treat them identically.

  • Need help to drag a rectangle to define a zoom level

    Can some help me figure this out. I am trying to draw some graphics on a JPanel, then drag a rectangle to define a new zoom extent. I am having problems understanding how to do this with the AffineTransform. If you run the following code, you will see what I am trying to do....
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Rectangle;
    import java.awt.Shape;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.AffineTransform;
    import java.awt.image.BufferedImage;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JToolBar;
    public class TestCase extends JPanel implements MouseListener, MouseMotionListener {
      private Integer _startX = 0; // start x for dragging of rectangle
      private Integer _startY = 0; // start y for dragging of rectangle
      private Integer _lastX = 0; // end x for dragging of rectangle
      private Integer _lastY = 0; // end y for dragging of rectangle
      private boolean _isDragging = false;
      private Rectangle _rect = new Rectangle();
      private Rectangle[] _rects = null;
      private Color[] _colors = null;
      protected BufferedImage _imageBuffer = null;
      protected AffineTransform _xform = null;
      public TestCase() {
        _xform = new AffineTransform();
        _rects = new Rectangle[6];
        _rects[0] = new Rectangle(0, 0, 100, 100);
        _rects[1] = new Rectangle(100, 100, 100, 100);
        _rects[2] = new Rectangle(200, 200, 100, 100);
        _rects[3] = new Rectangle(300, 300, 100, 100);
        _rects[4] = new Rectangle(200, 0, 50, 50);
        _rects[5] = new Rectangle(250, 50, 50, 50);
        _colors = new Color[6];
        _colors[0] = Color.RED;
        _colors[1] = Color.WHITE;
        _colors[2] = Color.BLUE;
        _colors[3] = Color.GREEN;
        _colors[4] = Color.YELLOW;
        _colors[5] = Color.CYAN;
        setBackground(Color.LIGHT_GRAY);
        addMouseListener(this);
        addMouseMotionListener(this);
      // The next three methods enable user to drag a retangle
      // First, set the start points of the rectangle
      public void mousePressed(MouseEvent e) {
        _startX = new Integer(e.getX());
        _startY = new Integer(e.getY());
        _lastX = new Integer(e.getX());
        _lastY = new Integer(e.getY());
        _isDragging = true;
      // Second, drag the rectangle
      public void mouseDragged(MouseEvent e) {
        _lastX = new Integer(e.getX());
        _lastY = new Integer(e.getY());
        repaint();
      // Third, complete the rectangle, then zoom
      public void mouseReleased(MouseEvent event) {
        _lastX = new Integer(event.getX());
        _lastY = new Integer(event.getY());
        _lastX = new Integer(event.getX());
        _lastY = new Integer(event.getY());
        Rectangle rect = new Rectangle(_startX, _startY, _lastX - _startX, _lastY - _startY);
        Double widPanel = new Integer(this.getWidth()).doubleValue() / _xform.getScaleX();
        Double hgtPanel = new Integer(getHeight()).doubleValue() / _xform.getScaleY();
        Double widRect = rect.getWidth();
        Double hgtRect = rect.getHeight();
        Double scalex = widPanel.doubleValue() / widRect;
        Double scaley = hgtPanel.doubleValue() / hgtRect;
        Double translatex = _startX.doubleValue() * scalex;
        Double translatey = _startY.doubleValue() * scaley;
        _xform.setToScale(scalex, scaley);
        _xform.setToTranslation(translatex, translatey);
        _isDragging = false;
        repaint();
      protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        if(_isDragging){
          g2.drawImage(_imageBuffer, 0, 0, this);
          g2.setPaint(Color.RED);
          g2.drawRect(_startX, _startY, _lastX - _startX, _lastY - _startY);
        else{
          paintPanel(g2);
      protected void paintPanel(Graphics2D g) {
        Double width = this.getSize().getWidth();
        Double height = this.getSize().getHeight();
        Dimension size = this.getSize();
        _imageBuffer = new BufferedImage(Math.round(width.floatValue()), Math.round(height.floatValue()), BufferedImage.TYPE_INT_RGB);
        Graphics2D graphics = (Graphics2D) _imageBuffer.getGraphics();
        graphics.setColor(Color.LIGHT_GRAY);
        graphics.fillRect(0, 0, this.getWidth(), this.getHeight());
        for(int i = 0; i <= _rects.length - 1; i++){
          Rectangle rect = _rects;
    Shape shape = _xform.createTransformedShape(rect);
    graphics.setColor(_colors[i]);
    graphics.fill(shape);
    g.drawImage(_imageBuffer, 0, 0, this);
    protected void zoomToExtent() {
    _xform.setToIdentity();
    repaint();
    public void mouseClicked(MouseEvent event) {
    public void mouseEntered(MouseEvent event) {
    public void mouseExited(MouseEvent event) {
    public void mouseMoved(MouseEvent event) {
    public static void main(String[] args) {
    final TestCase test = new TestCase();
    JButton btnFullExtent = new JButton("Reset");
    btnFullExtent.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    test.zoomToExtent();
    JToolBar toolBar = new JToolBar();
    toolBar.add(btnFullExtent);
    final JFrame f = new JFrame();
    f.getContentPane().setLayout(new BorderLayout());
    f.getContentPane().add(toolBar, BorderLayout.NORTH);
    f.getContentPane().add(new TestCase(), BorderLayout.CENTER);
    f.setSize(600, 400);
    f.setVisible(true);

    I modified you code a little bit, just so I could improve my understanding. I tried to swap out the class level scale and translate variables, with an AffineTransform object, but wasn't able to get it working? Do you know why this won't work?
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.Rectangle;
    import java.awt.Shape;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.geom.Rectangle2D;
    import java.util.Random;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JToolBar;
    public class TestCase extends JPanel implements MouseListener, MouseMotionListener {
      private Point start;
      private Point end;
      private boolean dragging = false;
      private double zoom_x = 1.0;
      private double zoom_y = 1.0;
      private double translateX;
      private double translateY;
      private Rectangle[] _rects = null;
      private Color[] _colors = null;
      public TestCase() {
        setBackground(Color.LIGHT_GRAY);
        _rects = new Rectangle[6];
        _rects[0] = new Rectangle(0, 0, 100, 100);
        _rects[1] = new Rectangle(100, 100, 100, 100);
        _rects[2] = new Rectangle(200, 200, 100, 100);
        _rects[3] = new Rectangle(300, 300, 100, 100);
        _rects[4] = new Rectangle(200, 0, 50, 50);
        _rects[5] = new Rectangle(250, 50, 50, 50);
        _colors = new Color[6];
        _colors[0] = Color.RED;
        _colors[1] = Color.WHITE;
        _colors[2] = Color.BLUE;
        _colors[3] = Color.GREEN;
        _colors[4] = Color.YELLOW;
        _colors[5] = Color.CYAN;
        addMouseListener(this);
        addMouseMotionListener(this);
      public void mousePressed(MouseEvent e) {
        start = e.getPoint();
        dragging = true;
      public void mouseDragged(MouseEvent e) {
        end = e.getPoint();
        repaint();
      public void mouseReleased(MouseEvent e) {
        end = e.getPoint();
        double visibleWidth = getWidth();
        double visibleHeight = getHeight();
        double selectedWidth = Math.abs(end.getX() - start.getX());
        double selectedHeight = Math.abs(end.getY() - start.getY());
        double zoomFactorX = visibleWidth / selectedWidth;
        double zoomFactorY = visibleHeight / selectedHeight;
        translateX -= start.x / zoom_x;
        translateY -= start.y / zoom_y;
        zoom_x *= zoomFactorX;
        zoom_y *= zoomFactorY;
        dragging = false;
        repaint();
      protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        Graphics2D g2 = (Graphics2D) g;
        paintShapes((Graphics2D) g2.create());
        if(dragging){
          g2.setPaint(Color.RED);
          g2.drawRect(start.x, start.y, end.x - start.x, end.y - start.y);
      private void paintShapes(Graphics2D g2) {
        System.out.println("translateX=" + translateX + ", translateY=" + translateY + ", zoom_x=" + zoom_x + ", zoom_y=" + zoom_y);
        g2.scale(zoom_x, zoom_y);
        g2.translate(translateX, translateY);
        for(int i = 0; i <= _rects.length - 1; i++){
          Rectangle rect = _rects;
    g2.setColor(_colors[i]);
    g2.fill(rect);
    public void reset() {
    zoom_x = 1.0;
    zoom_y = 1.0;
    translateX = 0;
    translateY = 0;
    repaint();
    public void mouseClicked(MouseEvent event) {
    public void mouseEntered(MouseEvent event) {
    public void mouseExited(MouseEvent event) {
    public void mouseMoved(MouseEvent event) {
    public static void main(String[] args) {
    final TestCase test = new TestCase();
    JButton btnFullExtent = new JButton("Reset");
    btnFullExtent.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent event) {
    test.reset();
    JToolBar toolBar = new JToolBar();
    toolBar.add(btnFullExtent);
    final JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.getContentPane().setLayout(new BorderLayout());
    f.getContentPane().add(toolBar, BorderLayout.NORTH);
    f.getContentPane().add(test, BorderLayout.CENTER);
    f.setSize(600, 400);
    f.setLocationRelativeTo(null);
    f.setVisible(true);

  • I can't get my iPad to find my Apple TV. Where do I find the rectangle with the triangle in it to turn on the tv link. I have no problem doing this from my macbookpro.

    I can't get my ipad4 to find my Apple TV box, I where do I find the little rectangle box with a triangle in it that I click on my MacBook Pro to turn on the appletv?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Check AirPlay is turned on on the Apple TV (turn it off and on if it already is)
    Check that both devices are on the same network (Settings > Wifi, on the mobile device and Settings > General > Network, on the Apple TV).
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router. (Also try removing it’s power cord for at least 30 seconds)
    Restart your mobile device.

  • Text put into a canvas element with context.fillText() always has a black box where each letter goes. If the text is black you just see the black rectangle. If the text is not black you see it on the black bounding box. Surely this is not right.

    This has happened on the last few versions of firefox, as long as canvas has been supported. I see other people's screen shots from canvas tutorials, and the text always looks normal. On my system, any text put into a canvas element via context.fillText() will have a black bounding box for each letter, sized appropriately for the letter. If the text is black, of course you only see rectangles. If the text is a contrasting color, then you can read it, but it looks bizarre.

    Thomas...same kind of crap here.
    I used Custom Text - entered a sentence, hit return, entered another.
    Set to 72 pt.
    The default alignment is centred - I want left aligned text...the text start point stays at the centre of frame and the sentence runs off the edge of the bounding box.
    There is no settings in the Text or Title inspector dialog to correct that!
    Using Transform will not sort it!

  • How to Trim Rectangle with text to create reflection?

    Hello Everyone,
    I am realtively new to Illustrator and I am facing a problem that I am hoping some expert here can resolve. I have some text and I have converted it to outlines. Now I want to create shine on it. I want to fill a rectangle with white color and then clip it with text to give reflection effect but I can't figure out how to do it. I have selected my text and rectangle and tried all options in path finder tool but nothing seems to work. Please guide me how can this be done.
    Regards,
    Afraz Ali

    Afraz Ali,
    If you want to have the colour/colours/colour transition of the rectangle where the text is is nothing outside it, in other words colour the text with the colouring of the rectangle, you may:
    Use Live Type over the rectangle, select both, and Object>Clipping Mask>Make.
    With outlined type, you have to turn the lettershapes into a Compound Shape first.
    As you can see, it is simpler to just use Live Type, and it is editable.

  • How to use the Rectangle class to draw an image and center it in a JPanel

    I sent an earlier post on how to center an image in a JPanel using the Rectangle class. I was asked to send an executable code which will show the malfunction. The code below is an executable code and a small part of a very big project. To simplifiy things, it is just a JFrame and a JPanel with an open dialog. Once executed the JFrame and the FileDialog will open. You can then navigate to a .gif or a .jpg picture and open it. What I want is for the picture to be centered in the middle of the JPanel and not the upper left corner. It is also important to stress that, I am usinig the Rectangle class to draw the Image. The region of interest is where the rectangle is created. In the constructor of the CenterRect class, I initialize the Rectangle class. Then I use paintComponent in the CenterRect class to draw the Image. The other classes are just support classes. The MyImage class is an extended image class which also has a draw() method. Any assistance in getting the Rectangle to show at the center of the JPanel without affecting the size and shape of the image will be greatly appreciated.
    I have divided the code into three parts. They are all supposed to be on one file in order to execute.
    import java.awt.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class CenterRect extends JPanel {
        public static Rectangle srcRect;
        Insets insets = null;
        Image image;
        MyImage imp;
        private double magnification;
        private int dstWidth, dstHeight;
        public CenterRect(MyImage imp){
            insets = getInsets();
            this.imp = imp;
            int width = imp.getWidth();
            int height = imp.getHeight();
            ImagePanel.init();
            srcRect = new Rectangle(0,0, width, height);
            srcRect.setLocation(0,0);
            setDrawingSize(width, height);
            magnification = 1.0;
        public void setDrawingSize(int width, int height) {
            dstWidth = width;
            dstHeight = height;
            setSize(dstWidth, dstHeight);
        public void paintComponent(Graphics g) {
            Image img = imp.getImage();
         try {
                if (img!=null)
                    g.drawImage(img,0,0, (int)(srcRect.width*magnification), (int)(srcRect.height*magnification),
              srcRect.x, srcRect.y, srcRect.x+srcRect.width, srcRect.y+srcRect.height, null);
            catch(OutOfMemoryError e) {e.printStackTrace();}
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new Opener().openImage();
    class Opener{
        private String dir;
        private String name;
        private static String defaultDirectory;
        JFrame parent;
        public Opener() {
            initComponents();
         public void initComponents(){
            parent = new JFrame();
            parent.setContentPane(ImagePanel.panel);
            parent.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
            parent.setExtendedState(JFrame.MAXIMIZED_BOTH);
            parent.setVisible(true);
        public void openDialog(String title, String path){
            if (path==null || path.equals("")) {
                FileDialog fd = new FileDialog(parent, title);
                defaultDirectory = "dir.image";
                if (defaultDirectory!=null)
                    fd.setDirectory(defaultDirectory);
                fd.setVisible(true);
                name = fd.getFile();
                if (name!=null) {
                    dir = fd.getDirectory();
                    defaultDirectory = dir;
                fd.dispose();
                if (parent==null)
                    return;
            } else {
                int i = path.lastIndexOf('/');
                if (i==-1)
                    i = path.lastIndexOf('\\');
                if (i>0) {
                    dir = path.substring(0, i+1);
                    name = path.substring(i+1);
                } else {
                    dir = "";
                    name = path;
        public MyImage openImage(String directory, String name) {
            MyImage imp = openJpegOrGif(dir, name);
            return imp;
        public void openImage() {
            openDialog("Open...", "");
            String directory = dir;
            String name = this.name;
            if (name==null)
                return;
            MyImage imp = openImage(directory, name);
            if (imp!=null) imp.show();
        MyImage openJpegOrGif(String dir, String name) {
                MyImage imp = null;
                Image img = Toolkit.getDefaultToolkit().getImage(dir+name);
                if (img!=null) {
                    imp = new MyImage(name, img);
                    FileInfo fi = new FileInfo();
                    fi.fileFormat = fi.GIF_OR_JPG;
                    fi.fileName = name;
                    fi.directory = dir;
                    imp.setFileInfo(fi);
                return imp;
    }

    This is the second part. It is a continuation of the first part. They are all supposed to be on one file.
    class MyImage implements ImageObserver{
        private int imageUpdateY, imageUpdateW,width,height;
        private boolean imageLoaded;
        private static int currentID = -1;
        private int ID;
        private static Component comp;
        protected ImageProcessor ip;
        private String title;
        protected Image img;
        private static int xbase = -1;
        private static int ybase,xloc,yloc;
        private static int count = 0;
        private static final int XINC = 8;
        private static final int YINC = 12;
        private int originalScale = 1;
        private FileInfo fileInfo;
        ImagePanel win;
        /** Constructs an ImagePlus from an AWT Image. The first argument
         * will be used as the title of the window that displays the image. */
        public MyImage(String title, Image img) {
            this.title = title;
             ID = --currentID;
            if (img!=null)
                setImage(img);
        public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h) {
             imageUpdateY = y;
             imageUpdateW = w;
             imageLoaded = (flags & (ALLBITS|FRAMEBITS|ABORT)) != 0;
         return !imageLoaded;
        public int getWidth() {
             return width;
        public int getHeight() {
             return height;
        /** Replaces the ImageProcessor, if any, with the one specified.
         * Set 'title' to null to leave the image title unchanged. */
        public void setProcessor(String title, ImageProcessor ip) {
            if (title!=null) this.title = title;
            this.ip = ip;
            img = ip.createImage();
            boolean newSize = width!=ip.getWidth() || height!=ip.getHeight();
         width = ip.getWidth();
         height = ip.getHeight();
         if (win!=null && newSize) {
                win = new ImagePanel(this);
        public void draw(){
            CenterRect ic = null;
            win = new ImagePanel(this);
            if (win!=null){
                win.addIC(this);
                win.getCanvas().repaint();
                ic = win .getCanvas();
                win.panel.add(ic);
                int width = win.imp.getWidth();
                int height = win.imp.getHeight();
                Point ijLoc = new Point(10,32);
                if (xbase==-1) {
                    xbase = 5;
                    ybase = ijLoc.y;
                    xloc = xbase;
                    yloc = ybase;
                if ((xloc+width)>ijLoc.x && yloc<(ybase+20))
                    yloc = ybase+20;
                    int x = xloc;
                    int y = yloc;
                    xloc += XINC;
                    yloc += YINC;
                    Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
                    count++;
                    if (count%6==0) {
                        xloc = xbase;
                        yloc = ybase;
                    int scale = 1;
                    while (xbase+XINC*4+width/scale>screen.width || ybase+YINC*4+height/scale>screen.height)
                        if (scale>1) {
                   originalScale = scale;
                   ic.setDrawingSize(width/scale, height/scale);
        /** Returns the current AWT image. */
        public Image getImage() {
            if (img==null && ip!=null)
                img = ip.createImage();
            return img;
        /** Replaces the AWT image, if any, with the one specified. */
        public void setImage(Image img) {
            waitForImage(img);
            this.img = img;
            JPanel panel = ImagePanel.panel;
            width = img.getWidth(panel);
            height = img.getHeight(panel);
            ip = null;
        /** Opens a window to display this image and clears the status bar. */
        public void show() {
            show("");
        /** Opens a window to display this image and displays
         * 'statusMessage' in the status bar. */
        public void show(String statusMessage) {
            if (img==null && ip!=null){
                img = ip.createImage();
            if ((img!=null) && (width>=0) && (height>=0)) {
                win = new ImagePanel(this);
                draw();
        private void waitForImage(Image img) {
        if (comp==null) {
            comp = ImagePanel.panel;
            if (comp==null)
                comp = new JPanel();
        imageLoaded = false;
        if (!comp.prepareImage(img, this)) {
            double progress;
            while (!imageLoaded) {
                if (imageUpdateW>1) {
                    progress = (double)imageUpdateY/imageUpdateW;
                    if (!(progress<1.0)) {
                        progress = 1.0 - (progress-1.0);
                        if (progress<0.0) progress = 0.9;
    public void setFileInfo(FileInfo fi) {
        fi.pixels = null;
        fileInfo = fi;
    }

Maybe you are looking for

  • How can I get the photos from my old icloud backup on to my computer?

    I got a replacement phone and now there are 2 iphone backups.  There's the old phone with the pictures on it I would like to put on to my windows 8 pc.  I can't figure out how to get them.  I can't restore them to my iphone because I already have ano

  • Program to Print Preview from Spool

    Hello gurus, I hope you guys could help me out...my requirement is to write an ABAP program that receives a spool number and displays its print preview to the user from there user can choose to print or delete the spool number Any advices ?:)

  • Make both 3510 storedge devices primary

    Hi All I have a v490 server connected to 2 disk units (3510 storedge) sometime in may we had a problem with them and at tha time we had the following: # ./sccli Available devices: 1. /dev/rdsk/c4t600C0FF0000000000B575928EE74EC00d0s2 [SUN StorEdge 351

  • Connecting an additional studio display sends the G5 to sleep

    I've got a G5 with a Lacie photon20 disply on it. When i connect a second display(17" studio LCD) then my computer goes to sleep after a couple of secounds.. what do you reckon is happening?

  • Corrupt data?

    Hi, When looking in the table in the database the following values are displayed: 31365080 14495080 When displaying the value in the sql editor with following code: select to_char(acis_uid) into v_test from h_ct_acq_iss where acis_nbseq = '875' and a