|
-
Mar 28th, 2000, 02:54 PM
#1
Thread Starter
transcendental analytic
That's an simple qwestion. If PSP can do it, why can't I. I need to set the % of how much the first image is faden into the second.
Can someone assist me?
-
Mar 28th, 2000, 05:33 PM
#2
New Member
Fading between two images is very easy thing to do.
x = 0-100
% value how much the first image is shown
R1,G1,B1 = all ranging from 0 to 255
1 pixel's red, green and blue components of image1
R2,G2,B2 = all ranging from 0 to 255
1 pixel's red, green and blue components of image2
R,G,B = all ranging from 0 to 255
1 pixel's red, green and blue components of result
R = ((x * R1) + ((100-x) * R2)) / 100
G = ((x * G1) + ((100-x) * G2)) / 100
B = ((x * B1) + ((100-x) * B2)) / 100
That was it. Very simple thing to do... but ofcourse you need to get to manipulate all RGB-values of images involved. If you want to do this from vb, I suggest that the images you want to crossfade are saved in 24-bit bmp-format(raw), and the result image created, will be also in the same format. Then you can just use LoadPicture to show the result image.
-
Mar 28th, 2000, 06:38 PM
#3
Thread Starter
transcendental analytic
Bah, no offence but I have already tried that, and it goes to slow for me to accept. I wan't the speed like in bitcomparations using blt's in API
-
Mar 28th, 2000, 07:31 PM
#4
Hyperactive Member
its been a while since i`ve done this sort of thing, but maybe use a look up table of all possible vals? Depends on whether your chip can do faster memory accesses vs actually calculating in real time. depends on cache/ram/processor speed. also, havent even thought about how big the lookup would have to be - must fit into cache for any sensible results.
a.
-
Mar 29th, 2000, 12:35 AM
#5
New Member
Bah, no offence but I have already tried that, and it goes to slow for me to accept. I wan't the speed like in bitcomparations using blt's in API
Eternal dilemma: 'I need more speed...'. If you really want speed to your routines, i suggest that you write a dll with C or C++. Then use it, and you should have routines fast enough.
-
Mar 29th, 2000, 03:32 AM
#6
Thread Starter
transcendental analytic
i suggest that you write a dll with C or C++. Then use it, and you should have routines fast enough. 
I don't have C or C++. Anyone that can do this for me? Or have another way of doing this?
-
Mar 29th, 2000, 04:48 PM
#7
Hyperactive Member
You could look for help from a *very* altruistic person on a usenet newsgroup (comp.lang.c, alt.programming etc)... or look for `demo` source - this sort of thing has been done before, many times, and very fast. (is hornet.org still up? or a mirror?) I imagine theres already some source somewhere on the net. Just probably not in Visual Basic, which was hardly written with speed of program execution in mind 
a.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|