I am making an image slide show. Till now I have done transitions using the matrix transformation but now I am trying to make transitions using some gray scale background image.
Can any body please give me an idea how can i perform that or can post some code to give me an idea.

Use a pixel shader for this. You can use some of the shaders in this library to get you started.. they just require that you add the technique to the shader but that's about it. Granted, this is for WPF.. but the concepts are going to be similar in that you have to load the shader, load two textures (texture0, texture1), set the two texture sampler registers to use those textures for the effect, and then set a register for "progress" that is a simple float between 0 and 1 to represent how much the transition has progressed.. then just render out all the passes.

I've actually done this in SlimDX, but my code is a little elaborate to post here.

I have learned to code for HLSL but i dont know how to use it in slimdx code for rendering an image file by the help of a texture and sprite to create various effects. can you please post a small code for just giving a hint, so that I can proceed further. I will be grateful to you.

Can you please post a little bit of the main working code. I will be grateful to you

Are you familiar with HLSL and how to set that up on the CPU side? If not, it's too much to go into in a thread post. If you do know how- then obtaining your greyscale would be easy:

Color.rgb = (Color.r+Color.g+Color.b)/3.0f;

A better formula to use would be:

Color.rgb = (Color.r * 0.299f + Color.g * 0.587f + Color.b * 0.114f);

The reason is that in terms of luminance (which is what the grayscale value is a representation of), the three colour primaries are not equally weighted. Use of those coefficients is fairly standard in image processing.

Currently working on an open world survival RPG - For info check out my Development blog:ByteWrangler

I have understood making pixel shader file and vertex shader file for doing image transition. But what should be the extension of the file when i am saving it for the pixel shader and the vertex shader.
How can I use these shader files in my slimdx c# code. I have gone through the examples of the pixel shader and vertex shader but they are not clear enough to show the use of pixel shader and vertex shader. please help me out to show the use of pixel shader and the vertex shader in slimdx or directx using c#.

DirectX - SlimDx - XNA, thery're all based off the same platform pretty much so the only different is the language used to access them and who is resonsible for memory clean up. In other words, you can take C++ directx code and easily turn it into XNA or SlimDX assembly. Just keep in mind that the XNA platform uses the right handed cordinate system.

Thank you very much for your reply. But I am looking for something that can guide me through making the pixel shader effects in windows form application. I will be very thankful to you if you can help me out in this context.

This is my code for the pixel shader use. The image is being displayed properly if I don't set the pixel shader but as and when I give the pixel shader to device then nothing is displayed.Please help me out to resolve this problem.

I'm not familar with slimDX but shouldnt you have an EFFECT file that loads the pixel shader (.fx) and use that handle to set the textures, colors, and other varables in the shader? Then you'd render with Device.DrawPrimitive() like you're currently doing. I dont' see where you are setting any vars in the pixelshader.

this is my pixel shader file that i am importing and there is no use of importing the effect file in this program. the vertex shader and pixel shader does required things. And below is my vertex shader code.

Postie -what you posted makes sense to me too but it looks like Yash14 is using pre-compiled shaders. Regardless, he'll still need to set vars and render using the same technique as your code. Currently he's using Device.SetTexture() which is a fixed function pipeline code. He needs to pass the texture into the shader as a varable. The code he posted is both a Progammable Pipeline and a Fixed Function Pipeleine.

Postie -what you posted makes sense to me too but it looks like Yash14 is using pre-compiled shaders. Regardless, he'll still need to set vars and render using the same technique as your code. Currently he's using Device.SetTexture() which is a fixed function pipeline code. He needs to pass the texture into the shader as a varable. The code he posted is both a Progammable Pipeline and a Fixed Function Pipeleine.

Yeah, it seemed like he was mixing shaders and the fixed function pipeline. I haven't used pre-compiled shaders myself, so that didn't make sense to me. Though I noted that the link you mentioned earlier is a link to a SlimDX tutorial for DirectX11, and he's trying to use DX9 (from his inclusion of "using SlimDX.Direct3D9"), so I didn't know if the bytecode stuff was how you handle shaders under dx11 and wouldn't work correctly with dx9, but I haven't used dx11 yet, so I wasn't sure and decided to post what I knew works for me.

Currently working on an open world survival RPG - For info check out my Development blog:ByteWrangler