alpha

Modifying UIButton's alpha property from another class

南笙酒味 提交于 2019-12-01 11:03:32
I'm trying to change the alpha of an UIButton from another class. The function that is called in set the alpha property of my UIButton is actually called because I've put a NSLog there and I can see how it works. I'd be thankful if you could give me any suggestion. Here's my current code. ViewController.h - (void) setAlphaToButton; @property (strong, nonatomic) IBOutlet UIButton *myButton; ViewController.m @synthesize myButton; - (void) setAlphaToButton { myButton.alpha = 0.5; NSLog(@"Alpha set"); } ImageViewSubclass.m - (void) tapDetected:(UITapGestureRecognizer *)tapRecognizer {

AlphaComposite Transparency with repaint overlaps into black

拜拜、爱过 提交于 2019-12-01 10:45:11
So I have an image on top of another panel, and that image is transparent so you can see the panel beneath it. What I'm trying to do is use repaint() to fade the image (which is drawn with the drawImage() method in java.awt.Graphics) out until it is completely transparent so you can see the panel beneath it clearly. As of now, the image is just fading into black instead of into a transparent texture. This is a little bit of my code right now: paintComponent method: public void paintComponent(Graphics g) { super.paintComponent(g); float alpha = 1f-(.01f*(float)opcounter); Graphics2D g2d =

Modifying UIButton's alpha property from another class

 ̄綄美尐妖づ 提交于 2019-12-01 09:38:33
问题 I'm trying to change the alpha of an UIButton from another class. The function that is called in set the alpha property of my UIButton is actually called because I've put a NSLog there and I can see how it works. I'd be thankful if you could give me any suggestion. Here's my current code. ViewController.h - (void) setAlphaToButton; @property (strong, nonatomic) IBOutlet UIButton *myButton; ViewController.m @synthesize myButton; - (void) setAlphaToButton { myButton.alpha = 0.5; NSLog(@"Alpha

How can I change Status Bar Alpha in iOS 13?

若如初见. 提交于 2019-12-01 08:02:14
I want to change the Status Bar Alpha in iOS 13. let statusBarWindow = UIApplication.shared.value(forKey: "statusBarWindow") as? UIWindow statusBarWindow?.alpha = 0.5 When I try this, the app crashes (Thread 1: signal SIGABRT). Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.' You can refer to the following answer to resolve your crash. var statusBarUIView:

Pixel by Pixel Color Conversion WriteableBitmap => PNG Black only to Color with Transparency

廉价感情. 提交于 2019-12-01 06:46:58
I am working on a silverlight application, where all my icons are PNGs. The color of all these icons is black, or rather black to gray, depending on the alpha value. Every PNG has a transparent background. Inside my application, I want to do a pixel by pixel color change from black or gray, let's say to red (before black) or light red (before gray). Walking through the bytes of every pixel, I recognized, that every full black pixel has an alpha value of 255. Those, who are gray, have an an alpha value between 1 and 254. An alpha value of 0 seem to be transparent. The RGB values are all 0 for

AlphaComposite Transparency with repaint overlaps into black

安稳与你 提交于 2019-12-01 06:20:41
问题 So I have an image on top of another panel, and that image is transparent so you can see the panel beneath it. What I'm trying to do is use repaint() to fade the image (which is drawn with the drawImage() method in java.awt.Graphics) out until it is completely transparent so you can see the panel beneath it clearly. As of now, the image is just fading into black instead of into a transparent texture. This is a little bit of my code right now: paintComponent method: public void paintComponent

Android: Nested linear layout with different alpha value

吃可爱长大的小学妹 提交于 2019-12-01 06:03:46
问题 I have a rectangular LinearLayout that has some margin, some round corners and an alpha value of 0.3. Inside this layout I have 4 different layouts as I display different images in different positions. My issue is that although the primary layout is 0.3, I want my child to be fully visible, or not affected by it's parent alpha, and I am wondering how I can please do that please? I have tried setting alpha=1 on the children layouts but it did not work. Setting it to 0 does make the children

Java: extract Alpha Channel from BufferedImage

断了今生、忘了曾经 提交于 2019-12-01 05:15:43
问题 I would like to extract the Alpha Channel from a bufferedimage and paint it in a separate image using greyscale. (like it is displayed in photoshop) 回答1: Not tested but contains the main points. public Image alpha2gray(BufferedImage src) { if (src.getType() != BufferedImage.TYPE_INT_ARGB) throw new RuntimeException("Wrong image type."); int w = src.getWidth(); int h = src.getHeight(); int[] srcBuffer = src.getData().getPixels(0, 0, w, h, (int[]) null); int[] dstBuffer = new int[w * h]; for

How can I set an entire view's alpha value in api level 7 (Android 2.1)

十年热恋 提交于 2019-12-01 04:59:01
问题 I have an arbitrary view that I want to fade in on top of another view. In api level 11 I see there is a setAlpha, but I'm stuck supporting api level 7. I haven't run across a simple way to do this. How can I set the alpha for the entire view without messing with each individual component? 回答1: You should be able to achieve a reasonable effect using an AlphaAnimation at API level 7. View v = findViewById(R.id.view2); AlphaAnimation aa = new AlphaAnimation(0f,1f); aa.setDuration(5000); v

Pixel by Pixel Color Conversion WriteableBitmap => PNG Black only to Color with Transparency

核能气质少年 提交于 2019-12-01 04:20:43
问题 I am working on a silverlight application, where all my icons are PNGs. The color of all these icons is black, or rather black to gray, depending on the alpha value. Every PNG has a transparent background. Inside my application, I want to do a pixel by pixel color change from black or gray, let's say to red (before black) or light red (before gray). Walking through the bytes of every pixel, I recognized, that every full black pixel has an alpha value of 255. Those, who are gray, have an an