비트 맵 이미지 뷰에 광선 효과를 만들었습니다. 그것의 작동하지만 내 겉 빛 색상 porblem있다.비트 맵 주위에서 바깥 쪽 광선 효과를 만드는 방법은 무엇입니까?
이 내 예상 디자인 외부 빛 색상 :
http://www.flashcomponents.net/component/professional-3d-carousel-as2-and-as3.html 링크
하지만 내 글로우 효과가 좋은 찾고하지 참조하십시오 예상 광선 효과를 만드는 방법 좀 도와주세요? 내가
예상 빛이 내 기대 스크린 샷을 참조하시기 바랍니다 ..... 프로그램 만하면 내가 안드로이드에 대한 새로운 오전
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
int margin = 24;
int halfMargin = margin/2;
// the glow radius
int glowRadius = 16;
// the glow color
int glowColor = Color.rgb(0, 192, 255);
// The original image to use
Bitmap src = BitmapFactory.decodeResource(getResources(),
R.drawable.ic_launcher);
// extract the alpha from the source image
Bitmap alpha = src.extractAlpha();
// The output bitmap (with the icon + glow)
Bitmap bmp = Bitmap.createBitmap(src.getWidth() + margin,
src.getHeight() + margin, Bitmap.Config.ARGB_8888);
// The canvas to paint on the image
Canvas canvas = new Canvas(bmp);
Paint paint = new Paint();
paint.setColor(glowColor);
// outer glow
paint.setMaskFilter(new BlurMaskFilter(glowRadius, Blur.OUTER));
canvas.drawBitmap(alpha, halfMargin, halfMargin, paint);
// original icon
canvas.drawBitmap(src, halfMargin, halfMargin, null);
((ImageView) findViewById(R.id.bmpImg)).setImageBitmap(bmp);
}
}
: 이 내 코드입니다 :
답변을 주셔서 감사합니다.이 개념에 익숙하지 않습니다. 한 번 더 생각해 봅니다. 내 글로우 효과를 표시하고 싶습니다. 상수 만 필요 없습니다. 아무 것도 잘못 입력하면 의견을 말하십시오. –
확대/축소하지 않을 것입니다. . 이를 구현하면 효과를 여러 화면 크기로 확장 할 수 있습니다. 또한 필요한 경우 Google.com에서 9 가지 패치 이미지에 대한 자습서를 찾도록 도울 수 있습니다. –
어떻게 그것이 대답을 받아 들일 지, 그것도 OP 질문. 9patch 이미지는 직사각형 또는 정사각형 모양으로 만 글로우 또는 경계선을 만듭니다. – xmen