Avatar of kretzschmar
kretzschmarFlag for Germany asked on

qow 21 : Fading/Blending effects of Pictures

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 ;-)

Delphi

Avatar of undefined
Last Comment
kretzschmar

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Jacco

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Jacco

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;
ASKER
kretzschmar

thanks jacco,

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

meikl ;-)
Member_2_248744

I thought there would be more entries for this. . . . you still looking for some blenders?
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER
kretzschmar

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 ;-)
SOLUTION
Member_2_248744

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
kretzschmar

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

be patient

meikl ;-)
ASKER
kretzschmar

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

meikl ;-)
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Member_2_248744

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? ?
Jacco

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
ASKER
kretzschmar

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 ;-)
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck