473,472 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Fade transition of a picture

Hi,

if you open the link below and click on "Show Me" and then "Toggle
Transition" Button you will see a wonderfull fade in / fade out transition of
2 pictures.

http://msdn.microsoft.com/library/de...lters/fade.asp

I want to have the same effect in Visual C++, dosen't matter with / or
without GDI+, but no .NET. I have a simple dialog with some controls and I
want to fade in / fade out some pictures on the dialog, some with fade
transition. I tried a lot: MemDC/double buffering, GDI+, what ever, but
allways I get a flicker on the screen.
Does anybody knows some good stuf to obtain the result like in the link
above in a Visual C++ app ?
For any idea thanks in advance!

Best Regards,
Emil
Jan 5 '06 #1
2 2667
a demo app that i made 2 years ago using C# did something like this by using
a forms property.

you can change the opacity of window forms. if you overlay one on top of the
other, you can use the opacity
of the foreground window to fade the picture in and out of view if you put
the picture behind it.

this would also work with windows forms in C++ .NET, and without too much
hassle.
this is probably also possible using plain GDI, but i have never used that.

but there might be better ways to do this.

kind regards,
Bruno.

there might be
"Emil" <Em**@discussions.microsoft.com> wrote in message
news:FB**********************************@microsof t.com...
Hi,

if you open the link below and click on "Show Me" and then "Toggle
Transition" Button you will see a wonderfull fade in / fade out transition
of
2 pictures.

http://msdn.microsoft.com/library/de...lters/fade.asp

I want to have the same effect in Visual C++, dosen't matter with / or
without GDI+, but no .NET. I have a simple dialog with some controls and I
want to fade in / fade out some pictures on the dialog, some with fade
transition. I tried a lot: MemDC/double buffering, GDI+, what ever, but
allways I get a flicker on the screen.
Does anybody knows some good stuf to obtain the result like in the link
above in a Visual C++ app ?
For any idea thanks in advance!

Best Regards,
Emil

Jan 5 '06 #2
Emil wrote:
Hi,

if you open the link below and click on "Show Me" and then "Toggle
Transition" Button you will see a wonderfull fade in / fade out
transition of 2 pictures.

http://msdn.microsoft.com/library/de...lters/fade.asp

I want to have the same effect in Visual C++, dosen't matter with / or
without GDI+, but no .NET. I have a simple dialog with some controls
and I
want to fade in / fade out some pictures on the dialog, some with fade
transition. I tried a lot: MemDC/double buffering, GDI+, what ever,
but
allways I get a flicker on the screen.
Does anybody knows some good stuf to obtain the result like in the
link
above in a Visual C++ app ?
For any idea thanks in advance!


A fade transition is typically done by overlaying one window on top of
another and adjusting the transparency of the top window.

The transition algorithm would be something like:

0. Assume that Window 1 contains picture A and you're going to transition to
picture B
1. Create Window 2 that exactly overlays window 1 and is 100% transperent
(see SetLayedWindowAttributes)
2. Copy Picture B to window 2 (e.g. SetDIBitsToDevice)
3. using a windows timer, animate the transparency of Window 2 from fully
transparent to fully opaque.
4. once window 2 is fully opaque, copy picture B to window 1 and then
destroy window 2

-cd
Jan 6 '06 #3

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

Similar topics

1
by: Robert Skidmore | last post by:
I am building an application that will fade one panel to another panel. Both panels will have picture boxes in them (thumbnails). This is what I have tried: private void...
2
by: ross | last post by:
I am attempting to develop a site that will allow photos to fade in gradually one over another when the link is clicked to show the next picture. I hope that I have described this correctly. Any...
2
by: Harshal | last post by:
Hello, I have following html file <html> <head> <script> var flag = true; function LoadNewImage()
4
by: Chris Lieb | last post by:
Hi, I am writing a class in JavaScript to cause a repeating fade effect. The fade class takes care of the fading and the rgb class takes care of manipulating rgb values: function rgb(red,...
2
by: hon123456 | last post by:
Dear all, I got four jpg file, I want to made them fade in / fade out continuously and repeatly in the same table cell of html (e.g. in the same <td></td>) How can I do that in javascript. Please...
1
by: John Smith | last post by:
I'm looking for javascript that will rotate 3-6 jpg images with a fade to white transition between images. I've got a script that will handle the rotation but not the fade. Maybe it can't be...
0
by: tristanlbailey | last post by:
I have been attempting to solve this problem for a few weeks now, but I'm not having much luck... I would like to create a seamless fading effect on each form/window in my program; one that, when...
4
by: Charles Packer | last post by:
In these Javascript-driven time-lapse "movies" ... http://cpacker.org/trees can the cross-fade be improved? I was grateful to be able to find the script on the Web at...
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.