alpha-transparency

Access to raw data in ARGB_8888 Android Bitmap

◇◆丶佛笑我妖孽 提交于 2020-01-09 18:06:55
问题 I am trying to access the raw data of a Bitmap in ARGB_8888 format on Android, using the copyPixelsToBuffer and copyPixelsFromBuffer methods. However, invocation of those calls seems to always apply the alpha channel to the rgb channels. I need the raw data in a byte[] or similar (to pass through JNI; yes, I know about bitmap.h in Android 2.2, cannot use that). Here is a sample: // Create 1x1 Bitmap with alpha channel, 8 bits per channel Bitmap one = Bitmap.createBitmap(1,1,Bitmap.Config.ARGB

Access to raw data in ARGB_8888 Android Bitmap

↘锁芯ラ 提交于 2020-01-09 18:04:12
问题 I am trying to access the raw data of a Bitmap in ARGB_8888 format on Android, using the copyPixelsToBuffer and copyPixelsFromBuffer methods. However, invocation of those calls seems to always apply the alpha channel to the rgb channels. I need the raw data in a byte[] or similar (to pass through JNI; yes, I know about bitmap.h in Android 2.2, cannot use that). Here is a sample: // Create 1x1 Bitmap with alpha channel, 8 bits per channel Bitmap one = Bitmap.createBitmap(1,1,Bitmap.Config.ARGB

Access to raw data in ARGB_8888 Android Bitmap

自古美人都是妖i 提交于 2020-01-09 18:00:59
问题 I am trying to access the raw data of a Bitmap in ARGB_8888 format on Android, using the copyPixelsToBuffer and copyPixelsFromBuffer methods. However, invocation of those calls seems to always apply the alpha channel to the rgb channels. I need the raw data in a byte[] or similar (to pass through JNI; yes, I know about bitmap.h in Android 2.2, cannot use that). Here is a sample: // Create 1x1 Bitmap with alpha channel, 8 bits per channel Bitmap one = Bitmap.createBitmap(1,1,Bitmap.Config.ARGB

Ignore parent View background?

情到浓时终转凉″ 提交于 2020-01-07 05:12:09
问题 In the real world, the example control panel layout (below) appears within its own FrameLayout (Fragment container) and (depending on whether the app is running on a tablet) alongside a map, whose colours are set by a colorpicker fired by the 'colour' buttons. (NB: The map and the control panel have different backgrounds.) On return from the colorpicker the associated map particle and the Button background are updated with the new color. The idea is that (as observed by the user) the colour

Saving PNG Drawable Android

China☆狼群 提交于 2020-01-05 08:31:29
问题 I know how to save an image with Bitmap.compress(), but I really want to save the image as a PNG with its alpha-transparency, and using Bitmap just kills my efforts. I can save it as a opaque PNG, but not as a transparent PNG file. Is there any approach to this? Thank you. 回答1: Try this out. I haven't tested it but it should work. Bitmap bitmap = Bitmap.createBitmap(width, height, Config.ARGB_8888); OutputStream stream = new FileOutputStream("/sdcard/test.png"); bitmap.compress(CompressFormat

How to create child layered alpha-transparent window?

落爺英雄遲暮 提交于 2020-01-02 09:13:44
问题 I am trying to create transparent child window. procedure TForm1.BtnGoClick(Sender: TObject); var bmp:TBitmap; BitmapPos: TPoint; BitmapSize: TSIZE; BlendFunction: _BLENDFUNCTION; exStyle: Cardinal; begin bmp := TBitmap.Create; bmp.LoadFromFile('my32bitbitmap.bmp'); exStyle := GetWindowLongA(Form2.Handle, GWL_EXSTYLE); if (exStyle and WS_EX_LAYERED = 0) then SetWindowLong(Form2.Handle, GWL_EXSTYLE, exStyle or WS_EX_LAYERED); BitmapPos := Point(0, 0); BitmapSize.cx := bmp.Width; BitmapSize.cy

Calculate resulting RGB from 2 colors, one is transparent

可紊 提交于 2019-12-30 02:21:42
问题 I'm looking for a formula to convert them. I know to convert a general transparency it is alpha * new + ( 1 - alpha ) * old I have: Color A : RGB( 85, 113, 135 ) Color B : RGB( 43, 169, 225 ) Color A has 90% opacity and is laid on top of Color B, resulting in Color C : RGB( 65, 119, 145 ) My question is, how does it get Color C? If I substitute Color B for another thing, how do I get Color C? Here's another example, same base color: Color A : RGB( 85, 113, 135 ) Color B : RGB( 45, 67, 82 ) --

Set transparent background using ImageMagick and commandline prompt

馋奶兔 提交于 2019-12-29 02:21:13
问题 Suppose you have any image (PNG or JPG). This image has a white background and I need to make this background transparent. I have tried with these examples: convert original.png -background none transparent.png convert original.png -background white -flatten -alpha off transparent.png but with no desirable results. How can I make it? IMPORTANT: Using convert command-line. 回答1: I am using ImageMagick 6.6.9-7 on Ubuntu 12.04. What worked for me was the following: convert test.png -transparent

How to create an h264 video with an alpha channel for use with HTML5 Canvas?

一曲冷凌霜 提交于 2019-12-28 04:58:04
问题 I've been interested in this demo: http://jakearchibald.com/scratch/alphavid/ I also saw this question on here: Can I have a video with transparent background using HTML5 video tag? But I can't seem to figure out: How do you create h264, ogg and webm video files with alpha channels? 回答1: If you open this video from your demo with QuickTime you will see a video with separate RGB and A regions: If you then look at the code for the demo, you will see that it is using one offscreen HTML5 Canvas