Search Results

Search found 2173 results on 87 pages for 'alpha transparency'.

Page 17/87 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • How to add Transparency information to a HEX color code?

    - by TK123
    I have to modify some code and the previous developer left this comment: color: color, // e.g. '#RRGGBBFF' - Last 2 digits are alpha information On the page there is a color picker that let's the user change text color. It gives HEX values like so: #RRGGBB And there is a slider that allows the user to change a text's transparency. It runs from 0.1 to 1 Somehow I need to get a 2 digit letter from this transparency amount and append it to the HEX value for it to work. Does anyone know how to append Alpga information to HEX color codes? What is the math formula for it? I guess the question can also be answered if anyone knows how to concert RGBA color values with transparency into HEX: rgba(255, 255, 255, 0.6)

    Read the article

  • What is this conversion called?

    - by LoudNPossiblyRight
    Is there a name or a term for this type of conversion in the c++ community? Has anyone seen this conversion be referred to as "implicit conversion"? class ALPHA{}; class BETA{ public: operator ALPHA(){return alpha;} private: ALPHA alpha; }; void func(ALPHA alpha){} int main(){ BETA beta; func(beta); return 0; }

    Read the article

  • flash as3, fade in/out layering problem

    - by Jackson Smith
    Ok, what im trying to do is make a day to night cycle behind my landscape. There is a sun and a moon, they rotate in a circle on opposite sides. (i.e. the sun is up when the moon is down and vice versa) when the sun is coming up it should fade from the night movieclip to the dawn movieclip, then when the sun is up a little bit more, fade into the day moviclip, this works quite well, but, for some reason, when it gets to the sunset, it just wont work :/ and the same goes for when it goes from the sunset to night :/ any and all healp is greatly appreciated, ive spent 5 hours trying to figure this out and cant! please help! stage.addEventListener(Event.ENTER_FRAME, daynightcycle) //setChildIndex(night, getChildIndex(day)); setChildIndex(sunset, 0); setChildIndex(day, 1); setChildIndex(dawn, 2); setChildIndex(night, 3); function daynightcycle(e:Event):void { if(sun.currentLabel == "dawn") { setChildIndex(sunset, 0); setChildIndex(day, 1); setChildIndex(dawn, 2); setChildIndex(night, 3); stage.addEventListener(Event.ENTER_FRAME, nightTdawn); }else if(sun.currentLabel == "sunset") { setChildIndex(dawn, 0); setChildIndex(night, 1); setChildIndex(sunset, 2); setChildIndex(day, 3); stage.addEventListener(Event.ENTER_FRAME, dayTsunset); }else if(sun.currentLabel == "night") { setChildIndex(day, 0); setChildIndex(dawn, 1); setChildIndex(night, 2); setChildIndex(sunset, 3); stage.addEventListener(Event.ENTER_FRAME, sunsetTnight); }else if(sun.currentLabel == "day") { setChildIndex(night, 0); setChildIndex(sunset, 1); setChildIndex(day, 2); setChildIndex(dawn, 3); stage.addEventListener(Event.ENTER_FRAME, dawnTday); }else if(sun.currentLabel == "switch") { stage.addEventListener(Event.ENTER_FRAME, switchLayers); } } function nightTdawn(e:Event):void { if(night.alpha != 0) { night.alpha -= 0.01; }else { stage.removeEventListener(Event.ENTER_FRAME, nightTdawn); night.alpha = 100; //setChildIndex(night, getChildIndex(sunset)); } } function dayTsunset(e:Event):void { if(day.alpha != 0) { day.alpha -= 0.01; }else { stage.removeEventListener(Event.ENTER_FRAME, dayTsunset); day.alpha = 100; //setChildIndex(day, getChildIndex(dawn)); } //day.visible = false; //sunset.visible = true; } function sunsetTnight(e:Event):void { if(sunset.alpha != 0) { sunset.alpha -= 0.01; }else{ stage.removeEventListener(Event.ENTER_FRAME, sunsetTnight); sunset.alpha = 100; //setChildIndex(sunset, (getChildIndex(day))); } //sunset.visible = false; //night.visible = true; } function dawnTday(e:Event):void { sunset.visible = true; day.visible = true; if(dawn.alpha != 0) { dawn.alpha -= 0.01; }else{ stage.removeEventListener(Event.ENTER_FRAME, dawnTday); dawn.alpha = 100; //setChildIndex(dawn, (getChildIndex(night))); } } function switchLayers(e:Event):void { setChildIndex(dawn, 0); setChildIndex(night, 1); setChildIndex(sunset, 2); setChildIndex(day, 3); night.alpha = 100; sunset.alpha = 100; day.alpha = 100; dawn.alpha = 100; stage.removeEventListener(Event.ENTER_FRAME, switchLayers); }

    Read the article

  • CoreGraphics on iPhone. What is the proper way to load a PNG file with pre-multiplied alpha?

    - by dugla
    For my iPhone 3D apps I am currently using CoreGraphics to load png files that have pre-multiplied alpha. Here are the essentials: // load a 4-channel rgba png file with pre-multiplied alpha. CGContextRef context = CGBitmapContextCreate(data, width, height, 8, num_channels * width, colorSpace, kCGImageAlphaPremultipliedLast | kCGBitmapByteOrder32Big); // Draw the image into the context CGRect rect = CGRectMake(0, 0, width, height); CGContextDrawImage(context, rect, image); CGContextRelease(context); I then go on and use the data as a texture in OpenGL. My question: By specifying pre-multiplied alpha - kCGImageAlphaPremultipliedLast - am I - inadvertently - telling CoreGraphics to multiply the r g b channels by alpha or - what I have assumed - am I merely indicating that the format of the incoming image has pre-multiplied alpha? Thanks, Doug

    Read the article

  • thoughs on using Alpha Five v10 with Codeless AJAX for building an AJAX database app in a short amou

    - by william Hunter
    I need to build an AJAX application against our MS SQL Server database for my company. the app has to have user permissions and reporting and is pretty complex. I am really under the gun in terms of time. The company that I work for needs the app for an important project launch. A colleague/friend of mine in a different company recommended that I look at a product from Alpha Software called Alpha Five v10 with Codeless AJAX. He has told me that he has used it extensively and that it saves him a "serious boat load of time" and he says that he has not run into limitations because you can also write your own JavaScript or you wire in JQERY. Before I commit to Alpha Five v10, I would like to get any other opinions? Thanks. Norman Stern. Chicago

    Read the article

  • How can I export PDF from InDesign so that transparency renders properly on all platforms?

    - by strangeronyourtrain
    Gradients, including drop shadows, all show up as solid blocks when I view my document on an Android phone. I tried different PDF compression and compatibility settings in an attempt to flatten and rasterize all the graphics, but it's clearly not working, as the Android viewer still identifies the outlines of transparent shapes instead of the blended pixels. Is there any way to truly flatten these PDF graphics, so that it doesn't matter whether a PDF viewer supports transparency, while keeping the text as text?

    Read the article

  • How to disable taskbar transparency in Windows 8 desktop?

    - by yzorg
    This post from how-to-geek to disable Aero in Win7 and Vista no longer works in Windows 8. Is there another way to disable taskbar transparency in Windows 8 desktop? Edit: On Win8 Aero was removed but the taskbar is transparent (the desktop background picture is slightly visible 'behind' the taskbar). When I'm using the taskbar to switch programs I don't like seeing artifacts 'bleeding-through', I find it distracting.

    Read the article

  • How to draw an CGImage with some alpha transparency?

    - by mystify
    Want to draw an UIImageView which has an CGImage, and the UIImageView has alpha 0.5f. But this CGContextDrawImage function doesnt take an transparency value. So how could I draw an image slightly transparent? To be clear: The image itself is not transparent, but I want it to be "dimmed" a little bit. Just like you would do with an UIImageView and some alpha like 0.5f :-)

    Read the article

  • Overlay section of my screen to another section with transparency and also can be clicked through [closed]

    - by steakbbq
    I am looking to make a program that accomplishes some simple goals. I need to be able to specify an area of my screen to have reproduced in a window. Similar to who the windows magnifier works. I also need it to stay on top. I also need it to be transparent. I also need it to be ghost like(mouse clicks go through it) so the application below can be interacted with still. Here is what I am trying to do. What would be the best way to go about it? http://i.imgur.com/0ahi7.jpg

    Read the article

  • IOC Container Handling State Params in Non-Default Constructor

    - by Mystagogue
    For the purpose of this discussion, there are two kinds of parameters an object constructor might take: state dependency or service dependency. Supplying a service dependency with an IOC container is easy: DI takes over. But in contrast, state dependencies are usually only known to the client. That is, the object requestor. It turns out that having a client supply the state params through an IOC Container is quite painful. I will show several different ways to do this, all of which have big problems, and ask the community if there is another option I'm missing. Let's begin: Before I added an IOC container to my project code, I started with a class like this: class Foobar { //parameters are state dependencies, not service dependencies public Foobar(string alpha, int omega){...}; //...other stuff } I decide to add a Logger service depdendency to the Foobar class, which perhaps I'll provide through DI: class Foobar { public Foobar(string alpha, int omega, ILogger log){...}; //...other stuff } But then I'm also told I need to make class Foobar itself "swappable." That is, I'm required to service-locate a Foobar instance. I add a new interface into the mix: class Foobar : IFoobar { public Foobar(string alpha, int omega, ILogger log){...}; //...other stuff } When I make the service locator call, it will DI the ILogger service dependency for me. Unfortunately the same is not true of the state dependencies Alpha and Omega. Some containers offer a syntax to address this: //Unity 2.0 pseudo-ish code: myContainer.Resolve<IFoobar>( new parameterOverride[] { {"alpha", "one"}, {"omega",2} } ); I like the feature, but I don't like that it is untyped and not evident to the developer what parameters must be passed (via intellisense, etc). So I look at another solution: //This is a "boiler plate" heavy approach! class Foobar : IFoobar { public Foobar (string alpha, int omega){...}; //...stuff } class FoobarFactory : IFoobarFactory { public IFoobar IFoobarFactory.Create(string alpha, int omega){ return new Foobar(alpha, omega); } } //fetch it... myContainer.Resolve<IFoobarFactory>().Create("one", 2); The above solves the type-safety and intellisense problem, but it (1) forced class Foobar to fetch an ILogger through a service locator rather than DI and (2) it requires me to make a bunch of boiler-plate (XXXFactory, IXXXFactory) for all varieties of Foobar implementations I might use. Should I decide to go with a pure service locator approach, it may not be a problem. But I still can't stand all the boiler-plate needed to make this work. So then I try this: //code named "concrete creator" class Foobar : IFoobar { public Foobar(string alpha, int omega, ILogger log){...}; static IFoobar Create(string alpha, int omega){ //unity 2.0 pseudo-ish code. Assume a common //service locator, or singleton holds the container... return Container.Resolve<IFoobar>( new parameterOverride[] {{"alpha", alpha},{"omega", omega} } ); } //Get my instance: Foobar.Create("alpha",2); I actually don't mind that I'm using the concrete "Foobar" class to create an IFoobar. It represents a base concept that I don't expect to change in my code. I also don't mind the lack of type-safety in the static "Create", because it is now encapsulated. My intellisense is working too! Any concrete instance made this way will ignore the supplied state params if they don't apply (a Unity 2.0 behavior). Perhaps a different concrete implementation "FooFoobar" might have a formal arg name mismatch, but I'm still pretty happy with it. But the big problem with this approach is that it only works effectively with Unity 2.0 (a mismatched parameter in Structure Map will throw an exception). So it is good only if I stay with Unity. The problem is, I'm beginning to like Structure Map a lot more. So now I go onto yet another option: class Foobar : IFoobar, IFoobarInit { public Foobar(ILogger log){...}; public IFoobar IFoobarInit.Initialize(string alpha, int omega){ this.alpha = alpha; this.omega = omega; return this; } } //now create it... IFoobar foo = myContainer.resolve<IFoobarInit>().Initialize("one", 2) Now with this I've got a somewhat nice compromise with the other approaches: (1) My arguments are type-safe / intellisense aware (2) I have a choice of fetching the ILogger via DI (shown above) or service locator, (3) there is no need to make one or more seperate concrete FoobarFactory classes (contrast with the verbose "boiler-plate" example code earlier), and (4) it reasonably upholds the principle "make interfaces easy to use correctly, and hard to use incorrectly." At least it arguably is no worse than the alternatives previously discussed. One acceptance barrier yet remains: I also want to apply "design by contract." Every sample I presented was intentionally favoring constructor injection (for state dependencies) because I want to preserve "invariant" support as most commonly practiced. Namely, the invariant is established when the constructor completes. In the sample above, the invarient is not established when object construction completes. As long as I'm doing home-grown "design by contract" I could just tell developers not to test the invariant until the Initialize(...) method is called. But more to the point, when .net 4.0 comes out I want to use its "code contract" support for design by contract. From what I read, it will not be compatible with this last approach. Curses! Of course it also occurs to me that my entire philosophy is off. Perhaps I'd be told that conjuring a Foobar : IFoobar via a service locator implies that it is a service - and services only have other service dependencies, they don't have state dependencies (such as the Alpha and Omega of these examples). I'm open to listening to such philosophical matters as well, but I'd also like to know what semi-authorative reference to read that would steer me down that thought path. So now I turn it to the community. What approach should I consider that I havn't yet? Must I really believe I've exhausted my options?

    Read the article

  • Is it possible to create a CImageList with alpha blending transparency?

    - by Sorin Sbarnea
    I would like to knwo if it is possible to create a CImageList with alpha blending transparency. Sample code that creates a CImageList with ugly transparency (no alpha blending) CGdiPlusBitmapResource m_pBitmap; m_pBitmap.Load(IDB_RIBBON_FILESMALL,_T("PNG"),AfxGetResourceHandle()); HBITMAP hBitmap; m_pBitmap.m_pBitmap->GetHBITMAP(RGB(0,0,0),&hBitmap ); CImageList *pList=new CImageList; CBitmap bm; bm.Attach(hBitmap); pList->Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 4); pList->Add(&bm, RGB(255,0,255));

    Read the article

  • How do I create an 8-bit PNG with transparency from an NSBitmapImageRep?

    - by Rob Keniger
    I have a 32-bit NSBitmapImageRep which has an alpha channel with essentially 1-bit values (the pixels are either on or off). I want to save this bitmap to an 8-bit PNG file with transparency. If I use the -representationUsingType:properties: method of NSBitmapImageRep and pass in NSPNGFileType, a 32-bit PNG is created, which is not what I want. I know that 8-bit PNGs can be read, they open in Preview with no problems, but is it possible to write this type of PNG file using any built-in Mac OS X APIs? I'm happy to drop down to Core Image or even QuickTime if necessary. A cursory examination of the CGImage docs didn't reveal anything obvious. EDIT: I've started a bounty on this question, if someone can provide working source code that takes a 32-bit NSBitmapImageRep and writes a 256-color PNG with 1-bit transparency, it's yours.

    Read the article

  • Why can't IE6 shows semi transparent png8 files with alpha filter ?

    - by vvo
    -- read the whole question before answering -- Hi, i work on a big website that had a lot (45000+) of png24 images (with semi transparency). I converted them to png8 and it works very well (a big help on page load time...). The thing is i had to keep png24 files for ie6 users (with alpha filter to have semi transparent pixels) because we all know that we can't use png 8 semi transparent images in IE6 : either the semi transparent pixels will be opaque or completely transparent. I tried to use the alpha image loader filter with png8 images but it just don't work, the pixels are still opaque/completely transparent, no semi transparency. What's the reason it's not working ? Is there a difference for IE when dealing with semi transparent pixels from a png24 or from a png8 ? I couldn't find any information on msdn websites or on stackoverflow... This is crazy... ! DISCLAIMER : i'm not searching for a f**ckin fix IE6 png or sh*t like that, i already know alpha image loader or htc techniques etc, theses all works well with PNG24 files but doesn't work with png8 files.

    Read the article

  • Why are some PNGs open in Photoshop with Indexed Colors and no transparency?

    - by Daniel Beardsley
    Why are some 32 bit PNGs opened in Photoshop with Indexed Colors and no transparency? For instance, I grabbed a png icon file of the Stack Overflow logo at: http://blog.stackoverflow.com/wp-content/uploads/icon-so.png When opening it in Photoshop CS3, it apparently treats it as indexed color and gets rid of the alpha channel. The image on the right is a screen grab of the icon. Changing the Image mode in Photoshop to RGB doesn't change the image at all. I've tried this with a few other PNGs and it seems hit or miss. When viewed in other programs, it displays fine. left:png opened in Photoshop, right:screen grab of png from browser What gives?, does Photoshop not interpret the PNG file format correctly?

    Read the article

  • How do I remove (or apply) transparency on a gdk-pixbuf?

    - by Andrew Stacey
    I have a c++ program in which a gdk-pixbuf is created. I want to output it as an image, so I call gdk_pixbuf_save_to_stream(pixbuf,stream,type,NULL,&err,NULL). This works fine when "type" is png or tiff, but with jpeg or bmp it just produces a black square. The original pixbuf consists of black-on-transparent (and gdk_pixbuf_get_has_alpha returns true) so I'm guessing that the problem is with the alpha mask. GdkPixbuf has a function to add an alpha channel, but I can't see one that removes it again, or (which might be as good) to invert it. Is there a simple way to get the jpeg and bmp formats to work properly? (I should say that I'm very new to proper programming like this.)

    Read the article

  • UCA + Natural Sorting

    - by Alix Axel
    I recently learnt that PHP already supports the Unicode Collation Algorithm via the intl extension: $array = array ( 'al', 'be', 'Alpha', 'Beta', 'Álpha', 'Àlpha', 'Älpha', '????', 'img10.png', 'img12.png', 'img1.png', 'img2.png', ); if (extension_loaded('intl') === true) { collator_asort(collator_create('root'), $array); } Array ( [0] => al [2] => Alpha [4] => Álpha [5] => Àlpha [6] => Älpha [1] => be [3] => Beta [11] => img1.png [9] => img10.png [8] => img12.png [10] => img2.png [7] => ???? ) As you can see this seems to work perfectly, even with mixed case strings! The only drawback I've encountered so far is that there is no support for natural sorting and I'm wondering what would be the best way to work around that, so that I can merge the best of the two worlds. I've tried to specify the Collator::SORT_NUMERIC sort flag but the result is way messier: collator_asort(collator_create('root'), $array, Collator::SORT_NUMERIC); Array ( [8] => img12.png [7] => ???? [9] => img10.png [10] => img2.png [11] => img1.png [6] => Älpha [5] => Àlpha [1] => be [2] => Alpha [3] => Beta [4] => Álpha [0] => al ) However, if I run the same test with only the img*.png values I get the ideal output: Array ( [3] => img1.png [2] => img2.png [1] => img10.png [0] => img12.png ) Can anyone think of a way to preserve the Unicode sorting while adding natural sorting capabilities?

    Read the article

  • Can a cur file have an alpha map (for high quality transparency)?

    - by Codemonkey
    I want to convert this Heroes of Newerth cursor into a cur file so I can use it as a cursor on windows and on my website. The cursor is now in a PNG file with an alpha map, and I have so far been unsuccessful in converting it to a cur file. The things I've tried is using the Photoshop cursor plugin to simply save the png as a cur. The result was a working cur file with a white background instead of a transparent one. I've also tried painting the background pure green (0, 255, 0) and saving as a cur file, in which case the background was still green when I tried using it as a windows cursor. I've also tried what's been mentioned in a few tutorials, which is selecting the area I want transparent and saving the selection in Photoshop (it then ends up as a new channel). So I selected the cursor and inverted the selection and saved it. The result was a bit odd. Instead of a transparent background, I now get a background that inverts the colours behind it, just like the "Windows inverted" mouse scheme. So is there any way to accomplish what I'm trying to do?

    Read the article

  • Authenticating Apache HTTPd against multiple LDAP servers with expired accounts

    - by Brian Bassett
    We're using mod_authnz_ldap and mod_authn_alias in Apache 2.2.9 (as shipped in Debian 5.0, 2.2.9-10+lenny7) to authenticate against multiple Active Directory domains for hosting a Subversion repository. Our current configuration is: # Turn up logging LogLevel debug # Define authentication providers <AuthnProviderAlias ldap alpha> AuthLDAPBindDN "CN=Subversion,OU=Service Accounts,O=Alpha" AuthLDAPBindPassword [[REDACTED]] AuthLDAPURL ldap://dc01.alpha:3268/?sAMAccountName?sub? </AuthnProviderAlias> <AuthnProviderAlias ldap beta> AuthLDAPBindDN "CN=LDAPAuth,OU=Service Accounts,O=Beta" AuthLDAPBindPassword [[REDACTED]] AuthLDAPURL ldap://ldap.beta:3268/?sAMAccountName?sub? </AuthnProviderAlias> # Subversion Repository <Location /svn> DAV svn SVNPath /opt/svn/repo AuthName "Subversion" AuthType Basic AuthBasicProvider alpha beta AuthzLDAPAuthoritative off AuthzSVNAccessFile /opt/svn/authz require valid-user </Location> We're encountering issues with users that have accounts in both Alpha and Beta, especially when their accounts in Alpha are expired (but still present; company policy is that the accounts live on for at a minimum of 1 year). For example, when the user x (which has en expired account in Alpha, and a valid account in Beta), the Apache error log reports the following: [Tue May 11 13:42:07 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14817] auth_ldap authenticate: using URL ldap://dc01.alpha:3268/?sAMAccountName?sub? [Tue May 11 13:42:08 2010] [warn] [client 10.1.1.104] [14817] auth_ldap authenticate: user x authentication failed; URI /svn/ [ldap_simple_bind_s() to check user credentials failed][Invalid credentials] [Tue May 11 13:42:08 2010] [error] [client 10.1.1.104] user x: authentication failure for "/svn/": Password Mismatch [Tue May 11 13:42:08 2010] [debug] mod_deflate.c(615): [client 10.1.1.104] Zlib: Compressed 527 to 359 : URL /svn/ Attempting to authenticate as a non-existant user (nobodycool) results in the correct behavior of querying both LDAP servers: [Tue May 11 13:42:40 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14815] auth_ldap authenticate: using URL ldap://dc01.alpha:3268/?sAMAccountName?sub? [Tue May 11 13:42:40 2010] [warn] [client 10.1.1.104] [14815] auth_ldap authenticate: user nobodycool authentication failed; URI /svn/ [User not found][No such object] [Tue May 11 13:42:40 2010] [debug] mod_authnz_ldap.c(377): [client 10.1.1.104] [14815] auth_ldap authenticate: using URL ldap://ldap.beta:3268/?sAMAccountName?sub? [Tue May 11 13:42:44 2010] [warn] [client 10.1.1.104] [14815] auth_ldap authenticate: user nobodycool authentication failed; URI /svn/ [User not found][No such object] [Tue May 11 13:42:44 2010] [error] [client 10.1.1.104] user nobodycool not found: /svn/ [Tue May 11 13:42:44 2010] [debug] mod_deflate.c(615): [client 10.1.1.104] Zlib: Compressed 527 to 359 : URL /svn/ How do I configure Apache to correctly query Beta if it encounters an expired account in Alpha?

    Read the article

  • Possible to change the alpha value of certain pixels on iPhone?

    - by emi1faber
    Is it possible to change just a portion of a Sprite's alpha in response to user interaction? A good example of what I mean is iFog or iSteam, where the user can wipe "steam" off the iPhone's screen. Swapping images out wouldn't be feasible due to the sheer number of possibilities where the user could touch and move... For example, say you have a simple app that has a brick wall in the background that has graffiti on it, so there'd be two sprites, one of the brick wall, then one of the graffiti that has a higher z value than the brick wall. Then, based upon where the user touches (assuming their touch controls a sandblaster), some of the graffiti should be removed, but not all of it, which could be accomplished by changing the alpha value on a portion of the graffiti sprite. Is there any way to do this in cocos2d-iphone? Or, do I need to drop down into openGL, and if so, where would be a good place to start my search on how to accomplish this? Ideally, I'd like to accomplish this on a cocos2d-iphone Sprite, but if it's not possible, where's the best place to start looking? Thanks in advance, Ben

    Read the article

  • Masking FLV video in AS3 with PNG alpha channel.

    - by James Roberts
    Hey there, I'm trying to mask an FLV with a PNG alpha channel. I'm using BitmapData (from a PNG) but it's not working. Is there anything I'm missing? Cut up code below: var musclesLoader:Loader = new Loader(); var musclesContainer:Sprite = new Sprite(); var musclesImage:Bitmap = new Bitmap(); var musclesBitmapData:BitmapData; var musclesVideo:Video = new Video(752, 451.2); var connection:NetConnection = new NetConnection(); var stream:NetStream; function loadMuscles():void { musclesLoader.load(new URLRequest('img/muscles.png')); musclesLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, musclesComplete); } function musclesComplete():void { musclesBitmapData = new BitmapData(musclesLoader.content.width, musclesLoader.content.height, true, 0x000000); musclesImage.bitmapData = musclesBitmapData; musclesImage.smoothing = true; musclesContainer.addChild(musclesImage); contentContainer.addChild(musclesContainer); } function loadMusclesVideo():void { connection.connect(null); stream = new NetStream(connection); stream.client = this; musclesVideo.mask = musclesBitmapData; stage.addChild(musclesVideo); musclesVideo.attachNetStream(stream); stream.bufferTime = 1; stream.receiveAudio(true); stream.receiveVideo(true); stream.play("vid/muscles.flv"); } Outside this code I have a function that adds the containers to the stage, etc and places the objects in the appropriate spots. It sort of works - the mask applies, but in a square (the size of the boundaries of musclesBitmapData) rather than with the shape of the alpha channel. Is this the right way to go about this?

    Read the article

  • How do I add a column that displays the number of distinct rows to this query?

    - by Fake Code Monkey Rashid
    Hello good people! I don't know how to ask my question clearly so I'll just show you the money. To start with, here's a sample table: CREATE TABLE sandbox ( id integer NOT NULL, callsign text NOT NULL, this text NOT NULL, that text NOT NULL, "timestamp" timestamp with time zone DEFAULT now() NOT NULL ); CREATE SEQUENCE sandbox_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER SEQUENCE sandbox_id_seq OWNED BY sandbox.id; SELECT pg_catalog.setval('sandbox_id_seq', 14, true); ALTER TABLE sandbox ALTER COLUMN id SET DEFAULT nextval('sandbox_id_seq'::regclass); INSERT INTO sandbox VALUES (1, 'alpha', 'foo', 'qux', '2010-12-29 16:51:09.897579+00'); INSERT INTO sandbox VALUES (2, 'alpha', 'foo', 'qux', '2010-12-29 16:51:36.108867+00'); INSERT INTO sandbox VALUES (3, 'bravo', 'bar', 'quxx', '2010-12-29 16:52:36.370507+00'); INSERT INTO sandbox VALUES (4, 'bravo', 'foo', 'quxx', '2010-12-29 16:52:47.584663+00'); INSERT INTO sandbox VALUES (5, 'charlie', 'foo', 'corge', '2010-12-29 16:53:00.742356+00'); INSERT INTO sandbox VALUES (6, 'delta', 'foo', 'qux', '2010-12-29 16:53:10.884721+00'); INSERT INTO sandbox VALUES (7, 'alpha', 'foo', 'corge', '2010-12-29 16:53:21.242904+00'); INSERT INTO sandbox VALUES (8, 'alpha', 'bar', 'corge', '2010-12-29 16:54:33.318907+00'); INSERT INTO sandbox VALUES (9, 'alpha', 'baz', 'quxx', '2010-12-29 16:54:38.727095+00'); INSERT INTO sandbox VALUES (10, 'alpha', 'bar', 'qux', '2010-12-29 16:54:46.237294+00'); INSERT INTO sandbox VALUES (11, 'alpha', 'baz', 'qux', '2010-12-29 16:54:53.891606+00'); INSERT INTO sandbox VALUES (12, 'alpha', 'baz', 'corge', '2010-12-29 16:55:39.596076+00'); INSERT INTO sandbox VALUES (13, 'alpha', 'baz', 'corge', '2010-12-29 16:55:44.834019+00'); INSERT INTO sandbox VALUES (14, 'alpha', 'foo', 'qux', '2010-12-29 16:55:52.848792+00'); ALTER TABLE ONLY sandbox ADD CONSTRAINT sandbox_pkey PRIMARY KEY (id); Here's the current SQL query I have: SELECT * FROM ( SELECT DISTINCT ON (this, that) id, this, that, timestamp FROM sandbox WHERE callsign = 'alpha' AND CAST(timestamp AS date) = '2010-12-29' ) playground ORDER BY timestamp DESC This is the result it gives me: id this that timestamp ----------------------------------------------------- 14 foo qux 2010-12-29 16:55:52.848792+00 13 baz corge 2010-12-29 16:55:44.834019+00 11 baz qux 2010-12-29 16:54:53.891606+00 10 bar qux 2010-12-29 16:54:46.237294+00 9 baz quxx 2010-12-29 16:54:38.727095+00 8 bar corge 2010-12-29 16:54:33.318907+00 7 foo corge 2010-12-29 16:53:21.242904+00 This is what I want to see: id this that timestamp count ------------------------------------------------------------- 14 foo qux 2010-12-29 16:55:52.848792+00 3 13 baz corge 2010-12-29 16:55:44.834019+00 2 11 baz qux 2010-12-29 16:54:53.891606+00 1 10 bar qux 2010-12-29 16:54:46.237294+00 1 9 baz quxx 2010-12-29 16:54:38.727095+00 1 8 bar corge 2010-12-29 16:54:33.318907+00 1 7 foo corge 2010-12-29 16:53:21.242904+00 1 EDIT: I'm using PostgreSQL 9.0.* (if that helps any).

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >