shape

Word VSTO - Filling a shape does not work in Word 2010 and Word 2013?

…衆ロ難τιáo~ 提交于 2019-12-02 12:37:51
I use the following VB.NET (VSTO) code to add a shape in MS-Word, Dim app As Word.Application = Globals.ThisAddIn.Application Dim doc As Word.Document = app.ActiveDocument Dim left As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdHorizontalPositionRelativeToPage))) Dim top As Single = CSng(Convert.ToDouble(app.Selection.Information(Word.WdInformation.wdVerticalPositionRelativeToPage))) Dim shape As Word.Shape = doc.Shapes.AddShape(1, left, top, 225.1F, 224.5F) shape.Fill.BackColor.RGB = ColorTranslator.ToOle(Color.Transparent) shape.Fill.Visible = Microsoft

How to 'Get' a Specific Point From A Shape Object Derived from AffineTransform

丶灬走出姿态 提交于 2019-12-02 10:29:55
问题 As a self-project, I'm trying to make the game 'Asteroids'. Currently, I'm stuck on trying to figure out how to make it so the lasers fired from my ship appear from the tip of the ship. So far, I've tried experimenting with using the Shape object's .getBounds2D().getX() methods, but because getBounds2D() draws a rectangle around the polygon, the lasers end up appearing from the corner of the imaginary 'box' around my Polygon ship . Here's a gif of what I have so far. Is there a way to 'get' a

How to Apply transformation to Polygon object in Java

こ雲淡風輕ζ 提交于 2019-12-02 08:41:00
i have made a transform and rendered a Polygon object with it(mesh is of type Polygon): at.setToTranslation(gameObject.position.x, gameObject.position.y); at.rotate(Math.toRadians(rotation)); at.scale(scale, scale); g2d.setTransform(at); g2d.fillPolygon(mesh); now i want to return the exact mesh i rendered so that i can do collision checks on it. only problem is that if i return mesh it returns the un-transformed mesh. so i tried setting the transform to the Polygon object (mesh) like so: mesh = (Polygon)at.createTransformedShape(mesh); but unfortunately at.createTransformedShape() returns a

ChainShape in Box2D

感情迁移 提交于 2019-12-02 08:39:37
I recently began to learn libgdx and I am stuck at a problem with the CainShape of Box2D. My first goal is to simply create a box with a ChainShape. In order to achieve that, I added four Vector2 to an array and use them to create a loop. The result is depending on the arrangement in the array either an hourglass shaped thing (top left is connected with bottom right and top right is connected with bottom left) or the error Expression: b2DistanceSquared(v1, v2) > 0.005f * 0.005f This is the code I used so far: Vector2[] box = new Vector2[4]; box[1] = new Vector2(0 - bounds.getWidth() / 2 / Main

Android - how to draw 2-directional gradient?

微笑、不失礼 提交于 2019-12-02 08:23:44
问题 I started playing with gradients and I've found it's pretty easy to draw 1-directional gradient (like from top to bottom, from left to right, or in diagonale...) but how to draw 2-directional gradient? I mean something like this: Big blue rectangle it's 2-directional gradient - on top right corner there is blue and to the left its transforming to white and to the bottom it's transforming to the black. How to draw this? 回答1: Answer is: you must combine 2 different LinearGradients, for example:

Error in method oncreat() when using shape android app

家住魔仙堡 提交于 2019-12-02 07:48:33
When I try to use the shapes in the design of Android applications, it is an error occurs without any details please help me My XML Code : <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText2" android:background="@drawable/yazeed" android:textSize="15sp" android:textStyle="bold" android:layout_gravity="center_horizontal" android:gravity="center" android:hint="Domain Name: Administrator@contos" /> My Shape : <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/androidandroid:shape="rectangle">

How to 'Get' a Specific Point From A Shape Object Derived from AffineTransform

妖精的绣舞 提交于 2019-12-02 06:56:51
As a self-project, I'm trying to make the game 'Asteroids'. Currently, I'm stuck on trying to figure out how to make it so the lasers fired from my ship appear from the tip of the ship. So far, I've tried experimenting with using the Shape object's .getBounds2D().getX() methods, but because getBounds2D() draws a rectangle around the polygon, the lasers end up appearing from the corner of the imaginary 'box' around my Polygon ship . Here's a gif of what I have so far. Is there a way to 'get' a specific point from a Shape object; where, in this case, that specific point is the tip of the ship.

Powerpoint editing how to copy one shape from one slide to another

跟風遠走 提交于 2019-12-02 06:14:32
问题 I'm a newbie in c# programming and I'm just confounded by the entire ms office library. I want to copy a textbox from one slide 3 and paste it in slide 2. I followed instruction from a page I found: How can I copy shapes from one slide to another slide in c#? presentation.Slides[3 + 1].Shapes[2 + 1].Copy(); presentaiton.Slides.Paste(2 + 1); But error message emerges and says: cannot paste because the clipboard is empty or contains things incompatible with the slide. I don't see the clipboard

Android - how to draw 2-directional gradient?

大城市里の小女人 提交于 2019-12-02 05:55:52
I started playing with gradients and I've found it's pretty easy to draw 1-directional gradient (like from top to bottom, from left to right, or in diagonale...) but how to draw 2-directional gradient? I mean something like this: Big blue rectangle it's 2-directional gradient - on top right corner there is blue and to the left its transforming to white and to the bottom it's transforming to the black. How to draw this? Answer is: you must combine 2 different LinearGradients, for example: LinearGradient val = new LinearGradient(0, 0, 0, height, Color.WHITE, Color.BLACK, TileMode.CLAMP);

Shapes combination in Java?

☆樱花仙子☆ 提交于 2019-12-02 05:00:18
Does java Shape interface contract and library routines allow combining multiple shapes into one object extending Shape interface? For example, may I define class Flower which will consist of several ovals for petals and core? Or the Shape supposes only one continuous outline? If so then is there any class in Java for holding multiple shapes, may be some class for vectorized graphics? To manipulate shapes in Java like you're describing, you want to use the Area class, which has these operations. Just convert a Shape to an Area with new Area(Shape) . Here is my attempt - using a rotate