shape

Android different EditText backgrounds for different states using shapes, selector or list

亡梦爱人 提交于 2019-11-27 05:16:56
I'm starting a new app where I use ActionBarSherlock & HoloEverywhereLib. My min & target SDK are the same (10/2.3.3). This is just so I can also quickly port it to Amazon Kindle & BB10 using the android runtime they have (already used this setup for another app and it worked without issue). All the while the app should have as close to ICS/JB look as possible. For my EditTexts though, I'm giving them a Girgerbread/iOS (round corners, but no shadows) look to them Someone mentioned to me a few weeks ago to grab the drawables for Gingerbread and use them to my EditTexts. but i starting using

Oblique or twisted border shape

假如想象 提交于 2019-11-27 03:50:08
问题 I'm interested if it's possible to create wrapped (or maybe better said twisted) border using CSS. Effect I wanted to achieve is in the picture. 回答1: Most easiest and neat solution would be to use svg to create the border. #container { position: relative; width: 200px; height: 30px; } #content { text-transform: uppercase; position: absolute; width: 200px; height: 30px; top: 0; text-align: center; line-height: 30px; } <div id="container"> <svg width="200" height="30" viewBox="-1 -2 201 33">

OpenCV closing a shape and filling it

末鹿安然 提交于 2019-11-27 02:43:44
问题 I want to output a blue-filled hand but get the incorrect output. I've included the input picture, incorrect output picture and code below. i think the code below does not fill the whole image because the image isn't closed yet at the right boundary. how do i close the shape and fill it with blue properly? #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <iostream> #include <stdio.h> #include <stdlib.h> using namespace cv;

Delphi - moving overlapping TShapes

∥☆過路亽.° 提交于 2019-11-27 02:06:28
I've needed own triangle shape so, I inherited my triangle class form TShape and override paint method. Everything works fine, but I need to move this shapes with mouse. I set the method for every shape handling onMouseDown event. Moving work also fine. But If two shapes overlaps (shapes are in fact rectangles with some transparent areas), that the top's shape transparent area is over another shape, then the top shape moves instead of the shape below. It's correct, that is how Delphi works. But it's not intuitive for the user. How can I achieve that? Is there possibility to not remove the

How do I draw an arrowhead (in Android)?

强颜欢笑 提交于 2019-11-27 01:43:53
I'm fairly new to Android and have been toying around with Canvas. I'm attempting to draw an arrow but I'm only having luck with drawing the shaft, none of the arrowhead is working. I have searched a bit and found a Java example, but Android doesn't have GeneralPath or AffineTransform . Right now my code looks like the following (the arrowhead looks nothing like an arrowhead): public class DrawableView extends View { Context mContext; private int centerX; private int centerY; private int radius; private double arrLength; private double arrHeading; private int margin = 10; public DrawableView

Finding Contours in OpenCV?

前提是你 提交于 2019-11-27 01:09:48
问题 When you retrieve contours from an image, you should get 2 contours per blob - one inner and one outer. Consider the circle below - since the circle is a line with a pixel width larger than one, you should be able to find two contours in the image - one from the inner part of the circle and one from the outer part. Using OpenCV, I want to retrieve the INNER contours. However, when I use findContours (), I only seem to be getting the outer contours. How would I retrieve the inner contours of a

JFrame the same shape as an Image / Program running in background

北城余情 提交于 2019-11-26 21:42:26
问题 My question is simple, the solution surely not. I am looking for a way to shape a JFrame the same as an Image it will be displaying. By shape I mean the shape of the pixels that have an alpha != 0. I've already found a working example using a GeneralPath object, but it created ~110000 "nodes" for an Image of about 500*400, so starting the JFrame took more than 2 minutes, which is definitely not the desired effect, the startup should be in under 2 seconds. Thanks for your time. 回答1: I

Oval Gradient in Android

廉价感情. 提交于 2019-11-26 20:56:57
问题 I know how to setup and display an oval shape. I know how to apply a gradient to this shape. What I cant figure out is how I can get an oval gradient to match the shape. <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <gradient android:startColor="#66FFFFFF" android:endColor="#00FFFFFF" android:gradientRadius="100" android:type="radial" /> </shape> If you can imagine, this gradient has a semi transparent white

How to get round shape in Android [duplicate]

青春壹個敷衍的年華 提交于 2019-11-26 19:17:12
问题 This question already has an answer here: How to define a circle shape in an Android xml drawable file? 15 answers How would I achieve a round shape in Android, like below, through an Android shape drawable: 回答1: You need to create a shape drawable in the drawable folder that looks something like: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" > <gradient android:startColor="#FFFF0000" android:endColor="#80FF00FF"

Android: Using linear gradient as background looks banded

可紊 提交于 2019-11-26 18:12:08
I'm trying to apply a linear gradient to my ListView. This is the content of my drawable xml: <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <gradient android:startColor="#3A3C39" android:endColor="#181818" android:angle="270" /> <corners android:radius="0dp" /> </shape> So I apply it to my ListView with: android:background="@drawable/shape_background_grey" It works but it looks very "banded" on emulator and on a real device too. Is there any way to reduce this "behaviour"? As Romain Guy suggests: listView.getBackground().setDither