예제 #1
0
 /// <summary>
 /// Flushes all reconstructable resources being used by this Image object.
 /// This includes any pixel data that is being cached for rendering to
 /// the screen as well as any system resources that are being used
 /// to store data or pixels for the image if they can be recreated.
 /// The image is reset to a state similar to when it was first created
 /// so that if it is again rendered, the image data will have to be
 /// recreated or fetched again from its source.
 /// <para>
 /// Examples of how this method affects specific types of Image object:
 /// <ul>
 /// <li>
 /// BufferedImage objects leave the primary Raster which stores their
 /// pixels untouched, but flush any information cached about those
 /// pixels such as copies uploaded to the display hardware for
 /// accelerated blits.
 /// <li>
 /// Image objects created by the Component methods which take a
 /// width and height leave their primary buffer of pixels untouched,
 /// but have all cached information released much like is done for
 /// BufferedImage objects.
 /// <li>
 /// VolatileImage objects release all of their pixel resources
 /// including their primary copy which is typically stored on
 /// the display hardware where resources are scarce.
 /// These objects can later be restored using their
 /// <seealso cref="java.awt.image.VolatileImage#validate validate"/>
 /// method.
 /// <li>
 /// Image objects created by the Toolkit and Component classes which are
 /// loaded from files, URLs or produced by an <seealso cref="ImageProducer"/>
 /// are unloaded and all local resources are released.
 /// These objects can later be reloaded from their original source
 /// as needed when they are rendered, just as when they were first
 /// created.
 /// </ul>
 /// </para>
 /// </summary>
 public virtual void Flush()
 {
     if (SurfaceManager != null)
     {
         SurfaceManager.flush();
     }
 }
예제 #2
0
 /// <summary>
 /// Returns an ImageCapabilities object which can be
 /// inquired as to the capabilities of this
 /// Image on the specified GraphicsConfiguration.
 /// This allows programmers to find
 /// out more runtime information on the specific Image
 /// object that they have created.  For example, the user
 /// might create a BufferedImage but the system may have
 /// no video memory left for creating an image of that
 /// size on the given GraphicsConfiguration, so although the object
 /// may be acceleratable in general, it
 /// does not have that capability on this GraphicsConfiguration. </summary>
 /// <param name="gc"> a <code>GraphicsConfiguration</code> object.  A value of null
 /// for this parameter will result in getting the image capabilities
 /// for the default <code>GraphicsConfiguration</code>. </param>
 /// <returns> an <code>ImageCapabilities</code> object that contains
 /// the capabilities of this <code>Image</code> on the specified
 /// GraphicsConfiguration. </returns>
 /// <seealso cref= java.awt.image.VolatileImage#getCapabilities()
 /// VolatileImage.getCapabilities()
 /// @since 1.5 </seealso>
 public virtual ImageCapabilities GetCapabilities(GraphicsConfiguration gc)
 {
     if (SurfaceManager != null)
     {
         return(SurfaceManager.getCapabilities(gc));
     }
     // Note: this is just a default object that gets returned in the
     // absence of any more specific information from a surfaceManager.
     // Subclasses of Image should either override this method or
     // make sure that they always have a non-null SurfaceManager
     // to return an ImageCapabilities object that is appropriate
     // for their given subclass type.
     return(DefaultImageCaps);
 }
예제 #3
0
 public virtual void SetSurfaceManager(Image img, SurfaceManager mgr)
 {
     img.SurfaceManager = mgr;
 }