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

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

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

Postby phobosonor » April 20th, 2007, 5:46 pm

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!! :shock: )..

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
Member
 
Posts: 4
Joined: April 20th, 2007, 5:32 pm

Oh and..

Postby phobosonor » April 21st, 2007, 5:51 am

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
Member
 
Posts: 4
Joined: April 20th, 2007, 5:32 pm

Postby Kambiz » April 22nd, 2007, 8:33 am

Instead of trial and error, use paper and pen to sketch your desired transition. You'll easily find the answer.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Great..

Postby phobosonor » April 22nd, 2007, 2:19 pm

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
Member
 
Posts: 4
Joined: April 20th, 2007, 5:32 pm

Postby Kambiz » April 22nd, 2007, 4:03 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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm

Postby phobosonor » April 22nd, 2007, 4:21 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
Member
 
Posts: 4
Joined: April 20th, 2007, 5:32 pm

Postby Kambiz » April 23rd, 2007, 1:03 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
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2408
Joined: March 7th, 2003, 7:10 pm


Return to DELPHI AREA Products

Who is online

Users browsing this forum: No registered users and 1 guest

cron