diff --git a/InForm/extensions/README - gifplay.txt b/InForm/extensions/README - gifplay.txt index 214f2fa..4b8f76f 100644 --- a/InForm/extensions/README - gifplay.txt +++ b/InForm/extensions/README - gifplay.txt @@ -27,6 +27,11 @@ the sample below: OpenGif is a function that takes a PictureBox control ID and a GIF file name and returns True if loading the animation is successful. + - FUNCTION TotalFrames(ID AS LONG) + + TotalFrames returns the total number of frames in a loaded gif. + If not an animated GIF, returns 1. + - SUB UpdateGif(ID) UpdateGif must be called from within the __UI_BeforeUpdateDisplay event. diff --git a/InForm/extensions/gifplay.bi b/InForm/extensions/gifplay.bi index c7ee283..b194663 100644 --- a/InForm/extensions/gifplay.bi +++ b/InForm/extensions/gifplay.bi @@ -26,6 +26,7 @@ TYPE GIFDATA Frame AS LONG LoadedFrames AS LONG GifLoadComplete AS _BYTE + LastFrameServed AS LONG LastFrameUpdate AS SINGLE LastFrameDelay AS SINGLE HideOverlay AS _BYTE diff --git a/InForm/extensions/gifplay.bm b/InForm/extensions/gifplay.bm index 10de548..cae4020 100644 --- a/InForm/extensions/gifplay.bm +++ b/InForm/extensions/gifplay.bm @@ -15,37 +15,22 @@ SUB UpdateGif (ID AS LONG) IF i = 0 THEN EXIT SUB IF GifOverlay = 0 THEN - DIM w AS INTEGER, prevFont AS LONG, prevDest AS LONG - prevFont = _FONT - _FONT Control(ID).Font - w = __UI_PrintWidth("GIF") + 30 - GifOverlay = _NEWIMAGE(w, w, 32) - prevDest = _DEST - _DEST GifOverlay - _FONT Control(ID).Font - CLS , _RGB32(255, 0, 255) - CIRCLE (w / 2, w / 2), w / 2 - 2, _RGB32(0, 0, 0) - PAINT (w / 2, w / 2), _RGB32(0, 0, 0), _RGB32(0, 0, 0) - COLOR _RGB32(255, 255, 255) - __UI_PrintString w / 2 - __UI_PrintWidth("GIF") / 2, w / 2 - uspacing& / 2, "GIF" - _CLEARCOLOR _RGB32(255, 0, 255) - _SETALPHA 127, _RGB32(0, 0, 0) - _DEST prevDest - _FONT prevFont + GifOverlay = LoadOverlayImage& END IF - IF GifData(i).IsPlaying THEN + IF GifData(i).IsPlaying OR GifData(i).LastFrameServed = 0 THEN IF GifData(i).LastFrameUpdate > 0 AND TIMER - GifData(i).LastFrameUpdate <= GifData(i).LastFrameDelay THEN 'Wait for the GIF's frame delay ELSE GifData(i).Frame = GifData(i).Frame + 1 + GifData(i).LastFrameServed = GifData(i).Frame GifData(i).LastFrameUpdate = TIMER END IF END IF BeginDraw ID _PUTIMAGE , GetGifFrame&(i) - IF GifData(i).IsPlaying = False AND GifData(i).HideOverlay = False THEN + IF GifData(i).IsPlaying = False AND GifData(i).HideOverlay = False AND GifData(i).totalFrames > 1 THEN _PUTIMAGE (_WIDTH / 2 - _WIDTH(GifOverlay) / 2, _HEIGHT / 2 - _HEIGHT(GifOverlay) / 2), GifOverlay END IF EndDraw ID @@ -57,6 +42,12 @@ FUNCTION IsPlaying%% (ID AS LONG) IsPlaying%% = GifData(i).IsPlaying END FUNCTION +FUNCTION TotalFrames&(ID AS LONG) + DIM i AS LONG + i = GetGifIndex(ID) + TotalFrames& = GifData(i).totalFrames +END FUNCTION + SUB HideGifOverlay (ID AS LONG) DIM i AS LONG i = GetGifIndex(ID) @@ -202,7 +193,7 @@ FUNCTION OpenGif%%(ID AS LONG, filename$) REDIM _PRESERVE GifFrameData(0 TO TotalGIFFrames) AS FRAMEDATA - GifData(Index).IsPlaying = True + GifData(Index).IsPlaying = False OpenGif%% = True EXIT FUNCTION @@ -461,4 +452,418 @@ SUB DecodeFrame (gifdata AS GIFDATA, GifFrameData AS FRAMEDATA) LastChar = ASC(MID$(a$, blockPointer, 1)) RETURN END SUB + +FUNCTION gifOverlayImage$ + DIM A$ + A$ = MKI$(64) + MKI$(64) + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000J000005000`M0000M20004<000`e0000V30008?000Pl0000" + A$ = A$ + "V3000L=000@`0000M2000L70000D0000J000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000003000PQ0000<30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?0000c0000620000300000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "00030000^1000X<000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000:3000h60000300000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000l0000@N0000Q30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000Q3000T7000`30000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000010000\5000`g0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "O3000\5000@0000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000R0000X;000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000j2000420" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000A1000D>000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000@i0000A100000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000000000@00000520008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000@Q0000100000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000P10000M20008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b3000d9000P1000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000000000000000000000P1" + A$ = A$ + "0000^20008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000^2000H00000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000@00000L20008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0000W00001000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000120008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b300088000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000000000000000@10008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000A10000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000P0000@>000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b3000@>00008000000000000000000000000000000000000000000000000" + A$ = A$ + "000010000T;000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000i2000400" + A$ = A$ + "000000000000000000000000000000000000000000000\5000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?0000G00000000000000000000" + A$ = A$ + "000000000000000000000l0000Pg0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000N3000l0000000000000000000000000000000000" + A$ = A$ + "00@N0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000@N000000000000000000000000000000`20000Q30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000Q3000`000000" + A$ = A$ + "00000000000000000000^10008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000PK000000000000000000001000" + A$ = A$ + "0l<000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000@30004000000000000000L3000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "000m0000f3000P?000Pn0000j3000X?000Pn0000h3000@?000`l0000b300" + A$ = A$ + "08?000Pl0000b30008?000@m0000h3000X?0000n0000f30008?000`l0000" + A$ = A$ + "g3000T?000Pn0000j3000X?000Pn0000j3000X?000Pn0000j3000X?000Pn" + A$ = A$ + "0000j3000P?000`l0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00`=000000000000000R0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b3000D?0000n0000j3000X?000Pn0000" + A$ = A$ + "j3000X?000Pn0000j3000X?000Pn0000i3000H?000Pl0000b30008?000@m" + A$ = A$ + "0000j3000X?000Pn0000j3000X?000Pm0000g3000X?000Pn0000j3000X?0" + A$ = A$ + "00Pn0000j3000X?000Pn0000j3000X?000Pn0000j3000X?000Pn0000i300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl00009200000000000000" + A$ = A$ + "<30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b3000H?000Pn0000jOb9WX?WLb9oNk]gnooooooooooooooooooooooZ" + A$ = A$ + "[^JoniWOl3000X?000Pn0000h30008?000Pl0000g3000X?^hRKoooooo;]d" + A$ = A$ + "Bk?000Pn0000h3000T?000PnZ[^jnooooooooooooooooooooooooooooooo" + A$ = A$ + "oooooooooooooooooooooooooooo\a6Kk3000X?000@m0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b3000d<000000000K00008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b3000H?000Pn0000j_jZ" + A$ = A$ + "[foooooooooooooooooooooooooooooooooooooooooooooooo_dB;]oWLb9" + A$ = A$ + "j3000X?000Pm0000b3000L?000PnhR;^mooooo_dB;]o0000j3000P?000@n" + A$ = A$ + "0000j[^jZkoooooooooooooooooooooooooooooooooooooooooooooooooo" + A$ = A$ + "oooooooooc6K\]?000Pn0000e30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000L000005000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b3000@?000Pn0000j;]dBkoooooooooooGLa5g_Oni7o" + A$ = A$ + "0000j3000X?000PnIUEFk_jZ[foooooooooook]gNk?000Pn0000j3000@?0" + A$ = A$ + "00`m0000jS;^hfooooooB;]dn3000X?0000n0000i3000X_jZ[^oooooogHS" + A$ = A$ + "=b?000Pn0000j3000X?000Pn0000j3000X?000Pn0000j3000X?000Pn0000" + A$ = A$ + "i30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300085000@O" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "000n0000jc9WLboooooooooooc6K\]?000Pn0000j3000X?000Pn0000j300" + A$ = A$ + "0X?000PnIUEFkoooooooooooLb9Wl3000X?000Pm0000g3000X?^hRKooooo" + A$ = A$ + "o;]dBk?000Pn0000h3000T?000PnZ[^jnoooooOS=f8o0000j3000X?000Pn" + A$ = A$ + "0000j3000X?000Pn0000j3000X?000Pn0000h3000000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b3000X?000Pnooooooooooo@3=dn0000j3000300000000000000920008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?0000m0000h3000X?000Pn0000" + A$ = A$ + "j3000X?000Pn0000j3000X?000Pn0000j3000X?0000n0000e30008?000Pl" + A$ = A$ + "0000e3000X?000Pn0000j3000X?000Pn0000f3000L?000Pn0000j3000X?0" + A$ = A$ + "00Pn0000j300000000000000000@00000@30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?0000d0000100000000000000000000h6000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000^10000000000" + A$ = A$ + "00000000000000030000R30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000R3000`000000000000000000000000000000" + A$ = A$ + "0T7000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b3000T700000000000000000000000000000000000`30000N30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b3000h=000@4000000000000" + A$ = A$ + "00000000000000000000000000000`5000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?0000G000000000000000000000000000000000000" + A$ = A$ + "0000000000@00000j20008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000P^" + A$ = A$ + "000010000000000000000000000000000000000000000000000000000420" + A$ = A$ + "000i0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?0000i0000Q0000000000000000000" + A$ = A$ + "00000000000000000000000000000000000000000000A10008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000A1000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000`P0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl000042000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "00000000000010000`9000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000L2000400000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000000000000000000000P1" + A$ = A$ + "0000^20008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000^2000H00000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000H0000@W0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000M2000H00000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000010000D8000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl000052000400000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000A1000D>000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000@i0000A1000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000P80000j20008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000P^0000Q0000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000400" + A$ = A$ + "000G0000O30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b3000l=0000G" + A$ = A$ + "000010000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000000000000000000000000000000000000000000000000l0000@N0000" + A$ = A$ + "Q30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000Q3000X7000`3000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "00000000000000000000000000000000000000000`0000PK0000;30008?0" + A$ = A$ + "00Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b300" + A$ = A$ + "08?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000`b0000" + A$ = A$ + "^1000`000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000<0000920000=000Pl0000" + A$ = A$ + "b30008?000Pl0000b30008?000Pl0000b30008?000Pl0000b30008?000Pl" + A$ = A$ + "0000b30008?000Pl0000@3000T80000<0000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000J000005000@N0000N20008<0" + A$ = A$ + "000f0000Y30008?000@k0000R30008=000P`0000N2000T70000D0000J000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "000000000000000000000000000000000000000000000000000000000000" + A$ = A$ + "0000%%00" + gifOverlayImage$ = A$ +END FUNCTION + +FUNCTION LoadOverlayImage& + DIM MemoryBlock AS _MEM, TempImage AS LONG, NextSlot AS LONG + DIM NewWidth AS INTEGER, NewHeight AS INTEGER, A$, BASFILE$ + + A$ = gifOverlayImage$ + IF LEN(A$) = 0 THEN EXIT FUNCTION + + NewWidth = CVI(LEFT$(A$, 2)) + NewHeight = CVI(MID$(A$, 3, 2)) + A$ = MID$(A$, 5) + + BASFILE$ = Unpack$(A$) + + TempImage = _NEWIMAGE(NewWidth, NewHeight, 32) + MemoryBlock = _MEMIMAGE(TempImage) + + __UI_MemCopy MemoryBlock.OFFSET, _OFFSET(BASFILE$), LEN(BASFILE$) + _MEMFREE MemoryBlock + + LoadOverlayImage& = TempImage +END FUNCTION + +FUNCTION Unpack$ (PackedData$) + 'Adapted from Dav's BIN2BAS + 'http://www.qbasicnews.com/dav/qb64.php + DIM A$, i&, B$, C%, F$, C$, t%, B&, X$, btemp$, BASFILE$ + + A$ = PackedData$ + + FOR i& = 1 TO LEN(A$) STEP 4: B$ = MID$(A$, i&, 4) + IF INSTR(1, B$, "%") THEN + FOR C% = 1 TO LEN(B$): F$ = MID$(B$, C%, 1) + IF F$ <> "%" THEN C$ = C$ + F$ + NEXT: B$ = C$ + END IF: FOR t% = LEN(B$) TO 1 STEP -1 + B& = B& * 64 + ASC(MID$(B$, t%)) - 48 + NEXT: X$ = "": FOR t% = 1 TO LEN(B$) - 1 + X$ = X$ + CHR$(B& AND 255): B& = B& \ 256 + NEXT: btemp$ = btemp$ + X$: NEXT + + Unpack$ = btemp$ +END FUNCTION '############################################################################################ diff --git a/InForm/extensions/gifplaySample.bas b/InForm/extensions/gifplaySample.bas index 8b13812..fc81f5c 100644 --- a/InForm/extensions/gifplaySample.bas +++ b/InForm/extensions/gifplaySample.bas @@ -40,7 +40,12 @@ SUB __UI_Click (id AS LONG) 'https://en.wikipedia.org/wiki/GIF#/media/File:Rotating_earth_(large).gif IF OpenGif(PictureBox1, "globe.gif") THEN Control(PlayBT).Disabled = False - Caption(PlayBT) = "Pause" + IF TotalFrames(PictureBox1) > 1 THEN + Caption(PlayBT) = "Play" + ELSE + Caption(PlayBT) = "Static gif" + Control(PlayBT).Disabled = True + END IF Caption(LoadBT) = "globe.gif loaded" Control(LoadBT).Disabled = True ELSE @@ -54,7 +59,7 @@ SUB __UI_Click (id AS LONG) PlayGif PictureBox1 Caption(PlayBT) = "Pause" END IF - CASE PictureBox1 + CASE PictureBox1 HideGifOverlay PictureBox1 END SELECT END SUB