Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread  requestAnimationFrame
Sun, Aug 7 2016 7:34 PMPermanent Link

Trinione

For animating, is there a way to use 'window.requestAnimationFrame' ?

I see lots of Canvas code that has animation using this and would like to do so within EWB and TPaint.
Mon, Aug 8 2016 1:26 PMPermanent Link

Trinione

This is not really related. But, it can provide a solution for me in the meantime.

Can a Base64 data be applied to the Canvas?  

I am really trying, but to no avail. Frown

--------------------------------------------------------------------------
img := TElement.Create();
img.src = 'data:image/png;base64,iFyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABK1......';

with Paint1.Canvas do
begin
     DrawImage(cog, 0, 0);
end;
Tue, Aug 9 2016 8:24 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com


<< For animating, is there a way to use 'window.requestAnimationFrame' ? >>

That's what *all* of the animation in EWB uses. Smile

<< I see lots of Canvas code that has animation using this and would like to do so within EWB and TPaint. >>

In the WebUI unit, look at the InterfaceManager class, specifically these methods:

        function BeginAnimation(AHandler: TInterfaceAnimationEvent): Integer;
        function ContinueAnimation(AID: Integer; AHandler: TInterfaceAnimationEvent): Integer;
        procedure CancelAnimation(AID: Integer);

They even substitute in timer-based animation for browsers that don't support the requestAnimationFrame functionality.

Tim Young
Elevate Software
www.elevatesoft.com
Image