473,395 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Blend Transitions between two images

Hello,

Is there any special functionality in C# to make a blend transition
between two images like the messager 6 do.

If no, does any one now how its done? how the guys that implemented
messager 6 do the transition from a old display picture to a new one?

Thanks
Nuno
Nov 15 '05 #1
4 7453
Nuno, I'm not exactly sure what you are trying to do or referring to. Could
you give a few more details?

--
Greg Ewing [MVP]
http://www.citidc.com

"Nuno Esculcas" <ne*******@hotmail.com> wrote in message
news:38**************************@posting.google.c om...
Hello,

Is there any special functionality in C# to make a blend transition
between two images like the messager 6 do.

If no, does any one now how its done? how the guys that implemented
messager 6 do the transition from a old display picture to a new one?

Thanks
Nuno

Nov 15 '05 #2
Hello again,

I want to make a small animation to switch bettween to images, like a
blend transition between the two images (the first one fades and the
second appears).
In VC++6 i use the AnimateWindow() function to make the same transition
but with Windows.

Now i only ask if there is any functionality like the AnimateWindow in
C# or anything like this.

Note: I'm afraid that this question is more for GDI+ but i can't call
the AnimateWindow in C# too, i'm afraid that i ve to make a platform
invoke to call the Win32 AnimateWindow function :(

Thanks
Nuno

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #3
I don't know how to do the transition automatically, but I know you
can do it manually. The Bitmap object has a GetPixel function which
will return the RGB value of a particular pixel of a picture. If you
get the RGB values of both pictures at the same pixel, it would be
possible to transition between the two pixel colors. This would be
processor intensive, so you may save off the resulting images to
display if you are going to show the transition multiple times.
I did something similar here, which you can modify to make the
transition.

public Bitmap PicAdd(Bitmap FirstImage, Bitmap SecondImage)
{
Bitmap bmp = (Bitmap)FirstImage.Clone();
byte red;
byte green;
byte blue;
for (int row = 0; row < SecondImage.Height; row++)
{
for (int col = 0; col < SecondImage.Width; col++)
{
red = (byte)(FirstImage.GetPixel(col, row).R &
SecondImage.GetPixel(col,row).R);
green = (byte)(FirstImage.GetPixel(col, row).G &
SecondImage.GetPixel(col,row).G);
blue = (byte)(FirstImage.GetPixel(col, row).B &
SecondImage.GetPixel(col,row).B);
Color color = Color.FromArgb(red, green, blue);
bmp.SetPixel(col, row, color);
}
}
return bmp;
}
Nov 15 '05 #4
"Toby Nance" <to********@student.oc.edu> wrote in message
news:a1*************************@posting.google.co m...
I don't know how to do the transition automatically, but I know you
can do it manually. The Bitmap object has a GetPixel function which
will return the RGB value of a particular pixel of a picture. If you
get the RGB values of both pictures at the same pixel, it would be
possible to transition between the two pixel colors. This would be
processor intensive, so you may save off the resulting images to
display if you are going to show the transition multiple times.
I did something similar here, which you can modify to make the
transition.


I would recommend NOT using GetPixel / SetPixel as they are really slow. If
you have to do it manually, then the only way to go is unsafe code with
bitmap.LockPixels and some pointer arithmetic. Here's a good example of
that:

http://www.codeproject.com/cs/media/...cfilters11.asp

On a smallish picture (maybe 100x100 pixes) performance will probably be
acceptable. If you're doing full screen fades, I think you'll find it hard
to get more than about two frames per second. DirectX would probably have
some routines to do it faster, but that's getting to be a lot of work for
just simple image transition.

I'm betting that P/Invoke is the way to go...
--
Mike Mayer
http://www.mag37.com/csharp/
mi**@mag37.com

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Whitney | last post by:
I ran across a chunk of code that allows me to blend images in and out (works great!) but now I need to figure out a way to randomize the order that these images appear. I have a bunch of pics and...
1
by: Dan | last post by:
Hi, I was wondering if anyone could come up with a cross browser image transition that I could use... I have already made one that works in IE but i know it doesn't work in Mozilla Firefox. ...
2
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
Is it possible to create a 2D Blend? I am familiar with Drawing.Drawing2D.Blend, but that class only allows you to specify positions and factors in 1D. I am also aware of the ability to set the...
5
by: a | last post by:
I have made a form in microsoft expression blend as control library. Can somebody please help me how to use that form from expression blend in C#
2
by: Vinnie | last post by:
ok, thanks for the help. Some of you, was right: too many words, to much marketing without identifying the final user. Smithers gave the easiest answer. Now, as i wasn't enough confused, on the...
1
by: bn4 | last post by:
I have been trying to modify a script that i had working in the past but have lost.. ORIGINAL URL: http://www.thescripts.com/forum/thread147097.html STEPS: I want it to do the following:...
1
by: Cirene | last post by:
When will Expression Blend 2 and Expression Web 2 be officially released (non-beta)?
9
by: Mohamed Mansour | last post by:
Hello, Last week I downloaded Microsoft Visual Studio 2008 Team Suite edition from MSDN Subscriptions, and I could create working WPF Applications. Today, I am fooling around with WPF again...
4
by: Lamont Sanford | last post by:
Could someone please explain why I as a Visual Studio 2008 user (WPF) would want the Expression Blend product? What does Blend offer that VS2008 does not? As far as I can tell, both products can be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.