473,915 Members | 6,681 Online
Bytes | Software Development & Data Engineering Community
+ 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 2704
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**@discussio ns.microsoft.co m> wrote in message
news:FB******** *************** ***********@mic rosoft.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 SetLayedWindowA ttributes)
2. Copy Picture B to window 2 (e.g. SetDIBitsToDevi ce)
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
7295
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 fade(System.Windows.Forms.Panel fP){ for (int i = 255; i >= 0;i--){ System.Threading.Thread.Sleep(10); fP.BackColor = System.Drawing.Color.FromArgb(i, 255,255,255); System.Windows.Forms.Application.DoEvents();
2
1361
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 suggestions please? Perhaps a page that is doing this at this time? I appreciate this newsgroup.Thank you, Dick Ross
2
2078
by: Harshal | last post by:
Hello, I have following html file <html> <head> <script> var flag = true; function LoadNewImage()
4
3538
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, green, blue) { // private variable initialization this.red = red; this.green = green;
2
6579
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 suggest answer, and if you like, please suggest website contains the source code. Thanks.
1
2008
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 done with JS? Thanks!
0
2564
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 an image is clicked with a mouse and held, the window fades away by approximately 50% transparency, and when the mouse button is released, fades back to opaque. I have been able to do this to an extent, with the SetLayeredWindowAttributes...
4
1329
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 http://slayeroffice.com/code/imageCrossFade/xfade2.html I used it as is, for example at http://cpacker.org/trees/arbviewa/xfade2.js since the timing turned out to be about what I wanted -- one image per second.
0
9883
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11359
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10928
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11069
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5944
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6149
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4346
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3370
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.