Sam's profileSamb Business Intelligen...PhotosBlogListsMore ![]() | Help |
|
April 24 Injecting Bitmaps streams into Images in WPF from Web Service CallsWhew, that's a big title. Ran into a great contact at the Atlantic City HLS DevCon, who asked me to post this code. OK, so, that little image of the chemical structure on the bottom comes at me as a stream from a web service call to Chemspider. Here's the call, and the creation of the bitmap image... try if (ids != null && ids.Length > 0) search_result.Width = 400; ri = r.NextDouble() * 30; object[] details = search.GetRecordDetails(id.ToString()); Label title = new Label(); Label urllink = new Label(); TextBox CKIKey = new TextBox(); TextBox CHI = new TextBox(); TextBox smiles = new TextBox(); // Get the image of the structure... BitmapImage bitImg = new BitmapImage(); bitImg.BeginInit(); MemoryStream ms = new MemoryStream(bigimg); bitImg.StreamSource = ms; bitImg.EndInit(); myImage.Source = bitImg; myImage.Width = 150; // Position the result in an overall canvas by posx, posy (posx is incremented to give your results a staggered look)
} April 23 HLS DevCon in Atlantic City, NJ - Gene Expression Map DemoI'm just about to do my presentation on WPF and Visualization in Life Sciences and wanted to post this up to my blog. You can find my slides here (on SkyDrive). At the end of the presentation, I built a Gene Expression map using WPF. Here are the steps to do it yourself, if you are so inclined. First, using Visual Studio 2008, start a new Windows program and create a new WPF Application. Here's the XAML... <Window x:Class="GeneExpression.Window1"
In the code-behind (XAML.cs)... using System; namespace GeneExpression private void Sparkle(object sender, MouseEventArgs e) private void NoSparkle(object sender, MouseEventArgs e) private void slider_ValueChanged(object sender, RoutedEventArgs e) } } }
I met a lot of great folks at DevCon(my first Health Care Devcon) - and I can't wait to see you this coming year. Thanks for coming! April 15 Home Foreclosure Heat Maphttp://hotpads.com/pages/features/foreclosures.htm This is just plain scary! HotPads Foreclosure Heat Maps portray the markets hit hardest by the recent housing crisis and the increased foreclosure rates. These foreclosure heat maps visually illustrate the foreclosures per capita and display color-coded foreclosure rates by county and state.
April 09 Intelligence for the Masses...Hawaii, the Highest Mountain on Earth?http://www.nsf.gov/news/special_reports/scivis/popup/hawaii.htm I thought this was an interesting visualization. Even though a cardinal rule of baselines is broken here, they manage to pull off using the curvature of the Earth as a baseline. Mount Everest is the highest mountain on Earth above sea level, but it’s not the world’s tallest mountain. That honor goes to the Hawaiian volcano Mauna Kea. When measured from its base on the Pacific Ocean floor, it is about 1,000 meters taller than Mount Everest. Mauna Kea is part of a 5,600-kilometer-long string of volcanoes stretching westward from the main Hawaiian island. Credit: Nils Sparwasser, Thorsten Andresen, Stephan Reiniger; Robert Meisner, German Aerospace Center (DLR) April 04 Rendering Live Web Pages in WPFI got a lot of help from my friend Michael Peters, of Oculus, so pay his blog a visit for me. In working on WPF, there are a number of reasons why someone might want to render a "live" web page on a canvas. By "live", I don't mean a dumb thumbnail - although that can have value too - I mean a fully navigable Web page that you can click and navigate. Here's how to do it. Download the WPFInterop codeplex entry. Create a Canvas (mine is called Pinboard) and add this code to create a dynamic button: Canvas backgrounder = new Canvas(); backgrounder.Background = new SolidColorBrush(Colors.Blue); Button pageresult = new Button(); PinBoard.Children.Add(backgrounder); Canvas.SetLeft(backgrounder, posx);
The Function, openwebFile returns a grid with the web page addressable by the URL (wpURL). private Grid openwebFile(Uri url) { Grid myGrid = new Grid(); System.Windows.Forms.WebBrowser sampleWB = new System.Windows.Forms.WebBrowser(); sampleWB.Size = new System.Drawing.Size(850, 1100); sampleWB.Url = url; WPFInterop.InteropInfoMesa2.Win32HostRenderer sampleRender = new WPFInterop.InteropInfoMesa2.Win32HostRenderer(); sampleRender.ContentControl = sampleWB; myGrid.Children.Add(sampleRender); return myGrid; } Here's the net effect of many web pages from a search coming back from Microsoft Live Web Service: It doesn't work perfectly (yet), so keep an eye out for new releases. Ray Tracing Molecules using the IBM BlueGene SuperComputerhttp://arxiv.org/PS_cache/arxiv/pdf/0801/0801.1500v1.pdf Michael McGuigan of the Brookhaven National Laboratory is using a BlueGene Supercomputer to perform Ray Tracing in real time against exceptionally complex objects. Instead of lighting each polygon and calculating impinging light on its surface, Ray Tracing, on the other hand, scans an imaginary particle of light through each pixel, bouncing and refracting in the way real light performs. This enables images of amazing realism. Intel is also talking more and more about this. Image of the 1e79 Atp phosphorylase molecule rendered with ambient |
|
|