alpha

Display PNG with alpha channel in C#

末鹿安然 提交于 2020-01-01 09:10:09
问题 Is there a way to properly display an image with alpha channel (let's say PNG) in C# application? Thank you for any suggestions. UPDATE: OK, my question was a bit unprecise. I'd like to acquire real transparency of alpha channel - not filling with the parent's background color. In the image below we can see that the transparency is supported, but the part of the button that lies below the image is not visible. Is it possible to have a real transparency of the alpha channel of an image? 回答1:

Display PNG with alpha channel in C#

孤街醉人 提交于 2020-01-01 09:10:03
问题 Is there a way to properly display an image with alpha channel (let's say PNG) in C# application? Thank you for any suggestions. UPDATE: OK, my question was a bit unprecise. I'd like to acquire real transparency of alpha channel - not filling with the parent's background color. In the image below we can see that the transparency is supported, but the part of the button that lies below the image is not visible. Is it possible to have a real transparency of the alpha channel of an image? 回答1:

How can I create alpha blended icon/cursor (indirect) from the TBitmap instance of 32 bpp w/o making an temporary DIB section?

℡╲_俬逩灬. 提交于 2020-01-01 05:36:12
问题 According to MS KB entry, there is a quirk in CreateIconIndirect which recognizes HBITMAP s been created with BITMAPV5HEADER passed to CreateDIBSection (and BGRA channel layout). However, TBitmap instances with (PixelFormat = pf32bit) and (AlphaFormat = afDefined) (behaving as alpha blended for the other purposes) when referred by its Handle s are not being recognized as valid alpha blended bitmaps for creation of icons or cursors. Currently, I have to create a full copy of TBitmap using

Android alpha animation fadein fadeout with delays

╄→гoц情女王★ 提交于 2019-12-29 10:28:47
问题 I want to do a very simple alpha animation but I cannot find a valid way. The idea is to perform this animation over a view: alpha from 0 to 1 of 1 second hold alpha at 1 for 5 seconds alpha from 1 to 0 of 1 second hold alpha at 0 for 5 seconds. start again on 1. I've tried to implement that with an AnimationSet as: AnimationSet animationSet = new AnimationSet(true); Animation animation1 = new AnimationUtils.loadAnimation(this, android.R.anim.fade_in); animation1.setDuration(1000); Animation

How to create semi transparent white window in XLib

扶醉桌前 提交于 2019-12-29 07:49:00
问题 I would like to create a semi transparent white window in XLib, but the window is not semi translucent, it remains fully opaque. I use the compton compositor and there are transparent windows in the system, so the problem is in the code: #include <X11/Xlib.h> #include <X11/Xutil.h> #include <stdio.h> int main(int argc, char* argv[]) { Display* display = XOpenDisplay(NULL); XVisualInfo vinfo; XMatchVisualInfo(display, DefaultScreen(display), 32, TrueColor, &vinfo); XSetWindowAttributes attr;

How to set fill alpha in PDF

十年热恋 提交于 2019-12-29 07:11:49
问题 This is a red box: 162 86 m 162 286 l 362 286 l 362 86 l h 1 0 0 rg f How can I add partial transparency to it? I've read the transparency section of the PDF spec, but I can only seem to find models and formulas, not how to actually add alpha to a fill. 回答1: As the OP indicated, there is a whole section in the PDF specification on the topic of Transparency . This is due to a multitude of ways to apply transparency. The most appropriate way for the OP's context is explained in the following

setAlpha behaving weird

帅比萌擦擦* 提交于 2019-12-25 11:54:52
问题 I have added a view with special params using windowmanager, it overlays the screen and I am trying to change the alpha of this view using a seekbar. I have tried changing the alpha of a button just to test my code, and it works properly, but when I try to change the alpha of the overlay view, it just changes colour to a transparent black (it is normally transparent pink or yellow). I was hoping to change the opacity of the yellow or pink, but it does not seem to work that way. I think it is

Bitmap with alpha channel crashes Bitmap () constructor only under Windows 7

人走茶凉 提交于 2019-12-25 06:50:19
问题 Ran into a weird Bitmap problem that I can't find in Google: The Bitmap constructor crashes on a file with an alpha channel under Windows 7, but works perfectly under Windows XP. The code couldn't be simpler: Bitmap image = new Bitmap (fname); The error is: "Parameter is not valid", and there's no inner exception. If it failed in Windows XP too, I'd suspect a simple bug, but since it works there it implies it's something more complex. Any ideas how a bitmap with an alpha channel can be loaded

PHP - alpha sort lines from several files in one directory and save them to files of “x” lines max in alpha named folders

孤街浪徒 提交于 2019-12-25 04:51:46
问题 This below goes through files in a directory, reads them and saves them in files of 500 lines max to a new directory. This works great for me (thanks Daniel) but, I need a modification. I would like to save to alpha num based files. First, sort the array alpha numerically (already lowercase) would be the first step I assume. Grab all of the lines in each $incoming."/.txt" that start with "a" and put them into a folder at $save500."/a" but, a max of 500 lines each. (I guess it would be best to

PHP - alpha sort lines from several files in one directory and save them to files of “x” lines max in alpha named folders

不想你离开。 提交于 2019-12-25 04:51:03
问题 This below goes through files in a directory, reads them and saves them in files of 500 lines max to a new directory. This works great for me (thanks Daniel) but, I need a modification. I would like to save to alpha num based files. First, sort the array alpha numerically (already lowercase) would be the first step I assume. Grab all of the lines in each $incoming."/.txt" that start with "a" and put them into a folder at $save500."/a" but, a max of 500 lines each. (I guess it would be best to