User Tools

Site Tools


displaying_20animated_20gifs

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
displaying_20animated_20gifs [2018/04/13 15:32] – Added syntax highlighting richardrusselldisplaying_20animated_20gifs [2024/01/05 00:22] (current) – external edit 127.0.0.1
Line 1: Line 1:
 =====Displaying animated GIFs===== =====Displaying animated GIFs=====
  
-//by Richard Russell, November 2007//\\ \\  The normal methods of displaying GIF image in a //BBC BASIC for Windows// program (using the code listed in the [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwine.html#gifjpeg|Help documentation]] or in the article [[/Displaying%20a%20JPEG%20or%20GIF%20in%20a%20picture%20box|Displaying a JPEG or GIF in a picture box]]) will not display an **animated GIF** - only the first frame of the animation will be shown.\\ \\  One straightforward method of displaying an animated GIF is to use an [[/Using%20an%20ATL%20container%20control|ATL container control]]. Assuming a suitable player is available (which there will be if **Internet Explorer** is installed on the PC) this will open and display the animation continuously until the ATL window is closed. An alternative method is to use [[/Playing%20a%20media%20file%20using%20Direct%20Show|Direct Show]] which gives a greater degree of control, for example you can pause and restart the animation. However it is still rather limiting, for example there is no straightforward way of controlling the animation speed.\\ \\  When you need more control, an alternative method of displaying animated GIFs is to use the **GDI Plus** subsystem, installed as standard on **Windows XP** and **Windows Vista** and available as a redistributable file for earlier versions (**Windows 98** onwards). See the Help documentation under [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#gdiplib|Library Routines... Antialiased graphics]] for more information on GDI+.\\ \\  To use this method you must first perform some initialisation, as follows:+//by Richard Russell, November 2007 amended January 2022// 
 + 
 +The easiest way of displaying an **animated GIF** is to use the **imglib** libraries supplied with //BBC BASIC for Windows// and //BBC BASIC for SDL 2.0//; see the relevant [[http://bbcbasic.co.uk/bbcsdl/manual/bbcsdlg.html#imglib|documentation]].  The rest of this article describes alternative methods that may be used in //BBC BASIC for Windows// (only). 
 + 
 +One straightforward method of displaying an animated GIF is to use an [[/Using%20an%20ATL%20container%20control|ATL container control]]. Assuming a suitable player is available (which there will be if **Internet Explorer** is installed on the PC) this will open and display the animation continuously until the ATL window is closed. An alternative method is to use [[/Playing%20a%20media%20file%20using%20Direct%20Show|Direct Show]] which gives a greater degree of control, for example you can pause and restart the animation. However it is still rather limiting, for example there is no straightforward way of controlling the animation speed.\\ \\  When you need more control, an alternative method of displaying animated GIFs is to use the **GDI Plus** subsystem, installed as standard on **Windows XP** and **Windows Vista** and available as a redistributable file for earlier versions (**Windows 98** onwards). See the Help documentation under [[http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#gdiplib|Library Routines... Antialiased graphics]] for more information on GDI+.\\ \\  To use this method you must first perform some initialisation, as follows:
  
 <code bb4w>  <code bb4w> 
displaying_20animated_20gifs.1523633554.txt.gz · Last modified: 2024/01/05 00:18 (external edit)