We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

qow 21 : Fading/Blending effects of Pictures

kretzschmar
kretzschmar asked
on
Medium Priority
1,609 Views
Last Modified: 2010-04-05
hi experts,

i will restart again qow (question of the week)
(thanks robert_marquardt for remembering :-))

each week i will introduce a new simple? question.

now qow 21

against the rules of the previous qows
all expert are allowed to solving this question.

the rule are:
- you must post your source here in this question.
- each different solution gets the points provided with this question
(means one expert can get multiple points, if the solutions are different)
- bonus (only for one solution), if a solution is special simple or clever,
or provides mutliple effects, this solution gets double-double-points (4x)


well the question is:

How to make fading/blending effects with two pictures?

Scenario Description:
i have two pictures, and want to see one after one with a nice noticeable,
fading/blending effect on my form.


for fast Validations, if you can, additional to the source-posting here,
send me your compiled project to
kretzschmar@experts-exchange.com

each different solution may get 125 pts (a-graded).

this question will be closed after 7 days.

have fun and let see

meikl ;-)

Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
Here is a blend for use with the framework.

Regards Jacco

PS: There is a small bug in the framework:
  ...
  if not Fade then
  begin
    img.Invalidate; <<<< need to be inserted to show the last step to user
    ...

function TfrmFade.Blend: Boolean;
type
  TRGBQuadArray = array[0..0] of TRGBQuad;
  PRGBQuadArray = ^TRGBQuadArray;
var
  i, s, d: PRGBQuadArray;
  liX, liY, liSteps: Integer;
begin
  liSteps := 500 div Speed;
  for liY := 0 to imgHeight-1 do
  begin
    i := img.Picture.Bitmap.ScanLine[liY];
    s := src.Picture.Bitmap.ScanLine[liY];
    d := dst.Picture.Bitmap.ScanLine[liY];
    for liX := 0 to imgWidth-1 do
    begin
      i[liX].rgbRed   := EnsureRange(Round(s[liX].rgbRed   + (d[liX].rgbRed   - s[liX].rgbRed  ) * (Step / liSteps)), 0, 255);
      i[liX].rgbGreen := EnsureRange(Round(s[liX].rgbGreen + (d[liX].rgbGreen - s[liX].rgbGreen) * (Step / liSteps)), 0, 255);
      i[liX].rgbBlue  := EnsureRange(Round(s[liX].rgbBlue  + (d[liX].rgbBlue  - s[liX].rgbBlue ) * (Step / liSteps)), 0, 255);
    end;
  end;
  Inc(Step);
  Result := not (Step = liSteps + 1);
end;
Top Expert 2004

Author

Commented:
thanks jacco,

i will validate your solutions later,
but a preview over your source looks good

meikl ;-)

Commented:
I thought there would be more entries for this. . . . you still looking for some blenders?
Top Expert 2004

Author

Commented:
well,
i expected also more participants :-(

>you still looking for some blenders?
yes, but selfmade

this question will be closed in about 10 hours.

meikl ;-)
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2004

Author

Commented:
sorry,
got no time for evaluation yet,
i will keep it open until next weekend.

be patient

meikl ;-)
Top Expert 2004

Author

Commented:
if you both agree,
i would spent 250 pts each.

meikl ;-)

Commented:
It seems you are a busy person   :-)
Thank you  meikl,  for the time and effort you have put here at EE ! !

you can do whatever seems best to you, I do not really need the points. . . .  I put this fade thing here so it might help somebody. . .

I was really hoping  for some more partisipation, entries,  for this qow
but EE seems so different now to me? ?

Commented:
I agree with Slick812.

I had hoped for some more response too. Maybe the stakes aren't high enough?

It might work with 1 high price and low frequency maybe monthly.

Regards Jacco
Top Expert 2004

Author

Commented:
well, thanks both :-))

>It might work with 1 high price and low frequency maybe monthly.
usually i have not the time to do it weekly, so i will take this suggestion

>I was really hoping  for some more partisipation, entries
i hoped this too, well maybe nexttime i will reask this q again

meikl ;-)
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.