home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_07.cab / DoubleBuffer.java < prev    next >
Text File  |  1997-11-01  |  1KB  |  42 lines

  1. ////////////////////////////////////////////////////////////////////////////
  2. // Implementatation of DoubleBuffer class
  3. //
  4. // Simply encapsulates the data required to store off-screen images.
  5. // 
  6. // This is a part of the Internet Information Server SDK Samples
  7. // Copyright (C) 1997 Microsoft Corporation
  8. // All rights reserved.
  9. //
  10. // This source code is only intended as a supplement to the Software 
  11. // Development Kit Reference and related electronic documentation provided.
  12. //
  13. ////////////////////////////////////////////////////////////////////////////
  14.  
  15. import java.applet.*;
  16. import java.awt.*;
  17.  
  18. class DoubleBuffer 
  19. {
  20.     private Image        m_imgBuff;                
  21.     private Graphics    m_gBuff;            
  22.     private Rectangle    m_rect;
  23.     private Applet        m_app;
  24.  
  25.     //////////////////////////////////////////////////////////////////////////////////
  26.     DoubleBuffer(Applet app, Rectangle rect)
  27.     {
  28.         m_rect = rect;
  29.         m_app = app;
  30.  
  31.         // build a buffer for the off-screen image
  32.         m_imgBuff = m_app.createImage(rect.width,rect.height);
  33.         m_gBuff = m_imgBuff.getGraphics();
  34.     }
  35.  
  36.     //////////////////////////////////////////////////////////////////////////////////
  37.     public Rectangle getSize()        { return m_rect; }
  38.     public Image getImage()            { return m_imgBuff; }
  39.     public Graphics getGraphics()    { return m_gBuff; }
  40. }
  41.  
  42.