Does Silverlight Support Bitmap datatype - silverlight-4.0

Hello Guys I am working on silverlight application and I want to make some color contrast and brightness so I am going to use with Bitmap datatype,but i am not able to do this.
Thanks...!!!

You can use WriteableBitmap to work with bitmaps programmatically. Unfortunately, there is no built-in functionality that allows you to change the contract/brightness of an image.

Related

Implementing Packed bubble Graph in WinRT

How I can implement packed bubble graph in WinRT. I am trying to achieve graph similar to attached image..
I tried for a similar implementation / sample for silverlight / Windows 8 in google, But didn't get any. Please anyone help me to achieve the same graph. My main issue is with implementing the logic correctly.
What kind of project are you using? There's actually a way to do this in each kind of supported project.
For javascript you can use the Canvas element, which has easy 2D api's for drawing circles and text.
In C++ you can use the DirectX 2D api's to draw circles. In C# you can embed a DirectX panel into your xaml and then use DirectX to draw the circles.
In C# or C++ you can also solve this problem with just xaml, using a ListView with Canvas for an ItemsPanel, and Circle objects. Here is a blog post I found with a tutorial (except with rectangles):
http://zamjad.wordpress.com/2010/03/17/using-canvas-as-a-itempanel-template-in-listbox/
Not sure if this fits your need. If you are not averse to using JS + HTML in WinRT, d3.js should be very very useful
Example of packed bubble chart - http://bl.ocks.org/mbostock/4063269
http://d3js.org/
Hope this helps!

Color Picker for Windows store App

I want to add a color picker control to a windows store App (using VB), I came to know that there is no standard control for that. So any ideas about what could be a good purchased or open source option?
So I started building one into WinRT XAML Toolkit here but never got round to finishing it. Mainly because I figured there would need to be very different designs for different platforms. The control isn't finished, but a lot of the components that are there you could use to build a color picker that fits your design. There's a ColorExtensions class that might help you convert between HSL/HSV/RGB models, there's a FromString() method in it that can parse a color string in the formats available in XAML (e.g. "Transparent" or #FFAA0080 or #FB0) and there's a WriteableBitmapColorPickerExtensions class that you can use to render a hue ring, 2D color selector bitmap or a 1D color bar. I'll probably create some usable controls one day to use all of these primitives, but for now - you have that power! :)
I've created a simple color picker for Universal Apps, you can read about it from this blog post...

Soft Brush for Paint App?

Like in Photoshop and many other painting/photo editing program that it lets you set the hardness of the brush.
Is it possible to do this with core graphics? Or I have to use OpenGL
PS. If I have to use OpenGL give me some codes and more details.
try CGContextSetShadowWithColor. The Shadow opacity depends on the shadow-color and the opacity of the drawn object. I believe applying a shadow to a full-tranzparent object is not possible without some masking.
... damn i wanted to add a new comment...

Is it possible to set background image for NSToolbar?

I am a new Mac developer and I have started to learn Cocoa. In my sample application I want to add a background image to my NSToolbar as a theme for my application and I want that image to be the full size of the toolbar. But i have checked and didn't get a solution. I want to know if it is really a possible thing.
Thanks and regards,
Mac 66
There is no public API to do this. You would need to do some "evil" things with private API or create your own toolbar mechanism. If you don't need things like item overflow, user customization, etc. then it might be easier/cleaner just to use standard buttons in the top margin of the window.

how to create a round/circular button in win32 API using visual c++

I have a Window (Win32 API) Application in Visual C++. I am not using MFC. I have to create a round/circular button with bitmap image. My application have a skinned view. Can any one help me out in achieving this task.
Buttons are windows. You can create a button with the CreateWindow or CreateWindowEx call:
-http://msdn.microsoft.com/en-us/library/ms632680(VS.85).aspx
When you create your button window ensure that you pass the BS_OWNDERDRAW style:
-http://msdn.microsoft.com/en-us/library/bb775951(VS.85).aspx
That will tell the button to send WM_DRAWITEM messages to your buttons' WNDPROC:
-http://msdn.microsoft.com/en-us/library/bb775923(v=VS.85).aspx
In your buttons' WNDPROC you would handle the WM_DRAWITEM message and paint your button according to the information in the DRAWITEMSTRUCT received as a pointer in lParam.
To render a bitmap as anything but rectangular you will need to provide a 1-bit bitmask bitmap the same size as the bitmap you wish to render for your button. The bitmask has bits set where you want the pixels in your button bitmap to be set on the screen. The pixels in your button bitmap that do not display need to be black. Bitblt your bitmask bitmap to the screen with the AND operator then OR your button bitmap. Of course you will need to account for the various button states (normally a push button is only two states.)
I may have mixed the black/white or set/unset bits in the explanation above, but the AND / OR bitwise (SRCAND/SRCPAINT) Raster Operations are the correct operations for what you are trying to acheive.
-http://msdn.microsoft.com/en-us/library/aa930997.aspx
Hope that helps.
You can google to find techniques for BitBlting images using memory DC and various ROP2 settings to achieve a masking effect. Your round image that represents the button would use a specific color to represent transparency. I don't have the specific code at hand but it is non-trivial.
The key api call you need to know is SetWindowRgn. This is what you call to tell windows that the the window is not rectangular but an irregular region. If you google around for that, you will find lots of sample code.
One promising example is this project. It does depend on MFC, but you can use it to learn what you need to call in what order to get the desired effect.