Search Results

Search found 3 results on 1 pages for 'rajenk'.

Page 1/1 | 1 

  • Overlay WriteableBitmap with color

    - by rajenk
    I'm trying to overlay a WriteableBitmap with a certain color in Silverlight. I have a black and white base image, which I'm using to create smaller WriteableBitmap images for a new composite image and I want to overlay either the black or white part of the source image cut-out with a certain color before adding it to the composite image. What I'm doing now is: var cutOut = new WriteableBitmap(8, 14); /* cut out the image here */ cutOut.Render(sourceImage, transform); // sourceImage is the base image cutOutImage.Source = cutOut; // cutOutImage is an Image element in XAML compositeImage.Render(cutOutImage, transform2); // compositeImage is the final WriteableBitmap that is shown on screen I tried the methods on http://blogs.silverarcade.com/silverlight-games-101/15/silverlight-blitting-and-blending-with-silverlights-writeablebitmap/ and using the extension methods from hxxp://writeablebitmapex.codeplex.com/, but I cannot seem to get a color overlay on the cutOut image before rendering it to the compositeImage. Does anyone know of a good method to do this? Thanks in advance.

    Read the article

  • Firing MouseLeftButtonDown event programmatically

    - by RajenK
    Hi, I'm trying to manually fire a MouseLeftButtonDown event on a WPF control programmatically, as I am using the Microsoft Surface SDK, which does not fire MouseLeftButtonDown events, but ContactDown events. Basically I'm trying to push the MouseLeftButtonDown event down to the control, to fire off the correct behavior on the control, while handling a ContactDown event. I'm guessing I have to somehow use the RaiseEvent method on the control to do this with MouseButtonEventArgs, but I'm having some trouble figuring out the parameters. Thanks in advance for your help!

    Read the article

  • Search for nodes by name in XmlDocument

    - by RajenK
    I'm trying to find a node by name in an XmlDocument with the following code: private XmlNode FindNode(XmlNodeList list, string nodeName) { if (list.Count > 0) { foreach (XmlNode node in list) { if (node.Name.Equals(nodeName)) return node; if (node.HasChildNodes) FindNode(node.ChildNodes, nodeName); } } return null; } I call the function with: FindNode(xmlDocument.ChildNodes, "somestring"); For some reason it always returns null and I'm not really sure why. Can someone help me out with this?

    Read the article

1