## Picshow Effects or How I Wish I Knew The Math!!

Please post bug reports, feature requests, or any question regarding the DELPHI AREA projects here.

### Picshow Effects or How I Wish I Knew The Math!!

The PicShow is awesome.. It does Expand/Crunch for directions Up/Down/Left/Right, and also for Left/Right and Top/Bottom simultaneously.. All good.. Slide does the Diagonal "Corners", TopLeft, TopRight, BottomRight, BottomLeft.. I have been trying to get Expand/Crunch to work on the Diagonal Corners like Slide does.. As my math skillz are not leet, I've been using trial and error, and having very little luck.. (Yes it's a shame luck should be involved here!! )..

So I assembled the commands that do Slide and Expand into one place so I could see them all and try various combinations, like below.. The closest I've been able to get to do an Expand BottomLeft is (the last one)..

Code: Select all
// Slide Bottom://  BitBlt(Display.Canvas.Handle, 0, H - Y, W, H,//         Image.Canvas.Handle, 0, 0,//         SRCCOPY);// Slide Left://  BitBlt(Display.Canvas.Handle, X - W, 0, W, H,//         Image.Canvas.Handle, 0, 0,//         SRCCOPY);// Slide Bottom-Left://  BitBlt(Display.Canvas.Handle, X - W, H - Y, W, H,//         Image.Canvas.Handle, 0, 0,//         SRCCOPY);// Expand Bottom..//  StretchBlt(Display.Canvas.Handle, 0, 0, W, (2 * H) - Y,//         Image.Canvas.Handle, 0, 0, W, Y,//         SRCCOPY);// Expand Left..//  StretchBlt(Display.Canvas.Handle, X - W, 0, (2 * W) - X, H,//         Image.Canvas.Handle, W - X, 0, X, H,//         SRCCOPY);// Expand Bottom-Left?//            Destination X, Y, W, H, Source X, Y, W, H  StretchBlt(Display.Canvas.Handle, X-W, Y-H, (2 * W) - X, (2 * H) - Y,         Image.Canvas.Handle, 0, 0, W, Y,         SRCCOPY);

Could some kind soul out there provide the StretchBlts to do the Expand and Crunch effects for all 4 diagonal corners, and even maybe the opposite corners simultaneously? (Like the Both Sides In/Out ones)??

Or just get one working (like Expand BottomLeft above) and I could try and figure out the others from there?

Anyway, great work Kambiz, and thanks for any help..

Regards,
Rob
phobosonor
Member

Posts: 4
Joined: April 20th, 2007, 5:32 pm

### Oh and..

By the way, when I say that code above does an almost expand bottom-left, that's in full reverse, starting with the picture fully displayed, then expanding towards bottom-left until it disappears..

Regards,
Rob
phobosonor
Member

Posts: 4
Joined: April 20th, 2007, 5:32 pm

Instead of trial and error, use paper and pen to sketch your desired transition. You'll easily find the answer.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

### Great..

Then would you please just delete this entire post? It's embarrassing to all but beg for help and be told to go back to school..

You think I hadn't tried before coming here and asking in public? I thought the answer might also help others too.. Ahh well..

Rob
phobosonor
Member

Posts: 4
Joined: April 20th, 2007, 5:32 pm

Why embarrassing? I told you the way that I've used to implement the transitions. If you want the final solution from me, I have to spend the same amount of time that you may spend to reach to the result. If I was good in mathematics, PicShow had a better code, more transitions, and lesser cpu usage.

Anyway, I apologize if my words were bothering you.
Kambiz

Kambiz

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

Man, has this gone totally wrong, and I regret responding in frustration..

You see, as you created Picshow, and the math it applies is totally beyond me, I assumed it would be a 10 second effort from you to suggest how to do a diagonal expand.. I've done what you suggested, and it just goes the opposite way.. I then of course tried reversing that, and it didn't work at all.. I also created a stringgrid that shows all 8 stretchblt values being applied as they progress through transitions, as an old saying I've always employed "when in doubt, print the data out", yet still the solution eluded me..

I will keep trying to find the answer, and again, I apologize for bothering you and acting like an idiot..

Rob
phobosonor
Member

Posts: 4
Joined: April 20th, 2007, 5:32 pm

It was just a misunderstanding. It could be because of my English, which is not good.

I still couldn't imagine what you are looking for. Could you please explain it using one or two image?
Kambiz

Kambiz