fading of two pictures (blend one picture into the other) 
Author Message
 fading of two pictures (blend one picture into the other)

Hi;

Quote:

>On Tue, 14 Dec 1999 09:31:17 +0100, "Peter Quick"

>>Lewis,
>>Nice job,
>>to speed it up use
>>      SetPixel Picture1(2).hdc, x, y, GetPixel(Picture1(0).hdc, x, y)

Try this to speed it up ...

 Dim hDC1 as Long, hDC2 as Long
 hDC1 = Picture1(2).hdc
 hDC2 = Picture1(0).hdc
 ...
 SetPixel hDC1, x, y, GetPixel(hDC2, x, y)
 ....

Hope this helps;
Rick

Quote:
>> ...

>Sorry, I've been pretty busy.

>I tried your suggested modification. Managed to get it working
>eventually, too, once I realised that I needed to set my scalemode
>back to 0 - twips. Unfortunately, it is now EXTREMELY slow, since it
>has to do about 9.8 million comparisons and moves, compared to about
>44,000 in my original version.

>Am I doing something wrong?



Mon, 01 Jul 2002 03:00:00 GMT  
 fading of two pictures (blend one picture into the other)
It's best to work in pixels when you're doing this, not twips.
If for some reason you /have/ to work in twips, then check the
value of Screen.TwipsPerPixelX and index accordingly:

intStep = Screen.TwipsPerPixelX
For x = 0 to intControlWidth Step intStep
...

You do /not/ want to do this every twip, as you've found out!
It's slow enough as it is!  ;-)

--

--------------------------------
"For every action, there is an equal and opposite criticism."


Quote:
> On Tue, 14 Dec 1999 09:31:17 +0100, "Peter Quick"

> >Lewis,
> >Nice job,
> >to speed it up use
> >      SetPixel Picture1(2).hdc, x, y,

GetPixel(Picture1(0).hdc, x, y)
Quote:
> > ...

> Sorry, I've been pretty busy.

> I tried your suggested modification. Managed to get it working
> eventually, too, once I realised that I needed to set my
scalemode
> back to 0 - twips. Unfortunately, it is now EXTREMELY slow,
since it
> has to do about 9.8 million comparisons and moves, compared to
about
> 44,000 in my original version.

> Am I doing something wrong?



Mon, 01 Jul 2002 03:00:00 GMT  
 fading of two pictures (blend one picture into the other)
Check out ImgX at http://DesignerControls.com


Quote:
> On Tue, 14 Dec 1999 09:31:17 +0100, "Peter Quick"

> >Lewis,
> >Nice job,
> >to speed it up use
> >      SetPixel Picture1(2).hdc, x, y, GetPixel(Picture1(0).hdc, x, y)
> > ...

> Sorry, I've been pretty busy.

> I tried your suggested modification. Managed to get it working
> eventually, too, once I realised that I needed to set my scalemode
> back to 0 - twips. Unfortunately, it is now EXTREMELY slow, since it
> has to do about 9.8 million comparisons and moves, compared to about
> 44,000 in my original version.

> Am I doing something wrong?



Mon, 01 Jul 2002 03:00:00 GMT  
 
 [ 18 post ]  Go to page: [1] [2]

 Relevant Pages 
 

 
Powered by phpBB® Forum Software