shape

Custom Shape Button Android

泄露秘密 提交于 2019-11-30 17:07:38
I have to address this type of views which has buttons below example. http://www.planet1107.net/blog/custom-shape-uibutton-tutorial/ It is in the iOS. so is there any way to make it in Android. I also have to give click events on all of those buttons. I would recommend just exporting these custom images to pngs. Then adding the pngs to your Android project and simply referencing them in the code or XML. Then on a click event you can simply change the icon to indicate that it has been clicked and if the user clicks on it one more time change it back. This will also ensure that the Android

How to make imageview with different shape in swift

眉间皱痕 提交于 2019-11-30 17:07:34
I want to change the normal ios imageview to this below image shape(Like arc) You can use this to design the shape as per your requirement, you can add extra lines to the path incase you need to modify the bezier path. Create a custom UIImageView class and subclass the image view in storyboard to your custom class. import UIKit class customImageView: UIImageView { // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during animation. // override func drawRect(rect: CGRect) // { // // // } override func setNeedsLayout() { let path =

Delphi7, make a shape jump when pressing Up key

房东的猫 提交于 2019-11-30 16:44:46
I'd like to make a shape jump when the player presses the UP key, so the best i could think of is this, but the method i used is terrible and problematic: (shape coordinates: shape1.top:=432;) procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin case key of vk_up: shape1.top:=shape1.top-40 //so that it jumps to 392 end; end; And now this timer: procedure TForm1.Timer1Timer(Sender: TObject); begin timer1.interval:=300 if shape1.Top<400 then //if shape1.top=392 < 400 begin shape1.Top:=432; //move back to 432 end; end; The problem is that players can constantly

How to make imageview with different shape in swift

不想你离开。 提交于 2019-11-30 16:21:06
问题 I want to change the normal ios imageview to this below image shape(Like arc) 回答1: You can use this to design the shape as per your requirement, you can add extra lines to the path incase you need to modify the bezier path. Create a custom UIImageView class and subclass the image view in storyboard to your custom class. import UIKit class customImageView: UIImageView { // Only override drawRect: if you perform custom drawing. // An empty implementation adversely affects performance during

AffineTransform: scaling a Shape from its center

北慕城南 提交于 2019-11-30 15:26:48
问题 I'm trying to scale a rectangle from its center using AffineTransform. I'm sure the solution is obvious but I cannot make it work ! Here is what I've tested so far... import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.AffineTransform; import javax.swing.JOptionPane; import javax.swing.JPanel; public class Test extends JPanel { Test() { super(null); setOpaque(true); setBackground(Color.WHITE);

Algorithm for shape calculation (Ellipse)

会有一股神秘感。 提交于 2019-11-30 15:07:38
I have n circles that must be perfectly surrounding an ellipse as shown in the picture here : In this picture I need to find out the position of each circle around the ellipse, and also be able to calculate the ellipse that will fit perfectly inside those surrounding circles. The information i know is the radius of each circles (all same), and the number of circles. Hopefully this time the post is clear. Thanks for your help. Please let me know if you need more explanation. OK as i understand you know common radius of circles R0 and their number N and want to know inside ellipse parameters and

AffineTransform: scaling a Shape from its center

不问归期 提交于 2019-11-30 14:33:29
I'm trying to scale a rectangle from its center using AffineTransform. I'm sure the solution is obvious but I cannot make it work ! Here is what I've tested so far... import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Rectangle; import java.awt.geom.AffineTransform; import javax.swing.JOptionPane; import javax.swing.JPanel; public class Test extends JPanel { Test() { super(null); setOpaque(true); setBackground(Color.WHITE); setPreferredSize(new Dimension(200,200)); } @Override protected void paintComponent(Graphics g1) {

Adding Shape to LinearLayout Android

这一生的挚爱 提交于 2019-11-30 13:21:55
问题 I have a linearLayout having some autocomplete and textboxes. I want to insert a shape (rectangle) in linearlayout. How can i achieve this. I am new comer to android. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp" android:id="@+id/layout"> <AutoCompleteTextView android:id="@+id/autocompleteCountry" android

Create layer list with rounded corners programmatically

笑着哭i 提交于 2019-11-30 12:43:47
I am currently trying to convert the following XML to be created programmatically so that I can set the top corners and bottom corners as needed throughout my project. It is a simple Layer list that has two rectangles; one on top of another. I would like to use this as a background for a few different views so it is important that the result scales. <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:bottom="20dp"> <shape android:shape="rectangle" > <size android:height="20dp" /> <solid android:color="#969595" /> <corners android:radius = "0dp" android

Change shape of JProgressBar [duplicate]

喜你入骨 提交于 2019-11-30 09:36:51
问题 This question already has answers here : Nice looking progress bar in java (2 answers) Can't change JProgressBar color in Mac OS look and feel (1 answer) Closed 6 years ago . I am new to Java but needs to know that if it is possible for a developer so that he/she can change the shape of the JProgressBar . I mean suppose in my case I want to change the shape so that it looks like a circle or something else? Though I just want it to be changed from a bar shape to an arc shape or you can say i