pict.h
上传用户:hzhsqp
上传日期:2007-01-06
资源大小:1600k
文件大小:7k
- /*
- * pict.h
- *
- * Metafile pixture image.
- *
- * Portable Windows Library
- *
- * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
- *
- * The contents of this file are subject to the Mozilla Public License
- * Version 1.0 (the "License"); you may not use this file except in
- * compliance with the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS"
- * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
- * the License for the specific language governing rights and limitations
- * under the License.
- *
- * The Original Code is Portable Windows Library.
- *
- * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
- *
- * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
- * All Rights Reserved.
- *
- * Contributor(s): ______________________________________.
- *
- * $Log: pict.h,v $
- * Revision 1.19 1999/08/24 06:54:36 robertj
- * Cleaned up the smart pointer code (macros).
- *
- * Revision 1.18 1999/03/10 03:49:52 robertj
- * More documentation adjustments.
- *
- * Revision 1.17 1999/03/09 08:01:49 robertj
- * Changed comments for doc++ support (more to come).
- *
- * Revision 1.16 1999/02/16 08:08:46 robertj
- * MSVC 6.0 compatibility changes.
- *
- * Revision 1.15 1998/09/23 06:27:59 robertj
- * Added open source copyright license.
- *
- * Revision 1.14 1995/03/14 12:42:01 robertj
- * Updated documentation to use HTML codes.
- *
- * Revision 1.13 1995/01/09 12:38:56 robertj
- * Documentation.
- *
- * Revision 1.12 1994/12/12 10:04:44 robertj
- * Renamed PWrapper to PSmartPointer.
- *
- * Revision 1.11 1994/12/05 11:34:11 robertj
- * Major rewrite of images, pictures and pixmaps.
- * Renamed PPict, PPixels and PImage to make sure all uses are found.
- *
- * Revision 1.10 1994/10/23 04:50:13 robertj
- * Changed Save to Write to better match Read function.
- *
- * Revision 1.9 1994/08/23 11:32:52 robertj
- * Oops
- *
- * Revision 1.8 1994/08/22 00:46:48 robertj
- * Added pragma fro GNU C++ compiler.
- *
- * Revision 1.7 1994/06/25 11:55:15 robertj
- * Unix version synchronisation.
- *
- * Revision 1.6 1994/04/03 08:34:18 robertj
- * Added help and focus functionality.
- *
- * Revision 1.5 1994/01/03 04:42:23 robertj
- * Mass changes to common container classes and interactors etc etc etc.
- *
- * Revision 1.4 1993/12/31 06:45:38 robertj
- * Made inlines optional for debugging purposes.
- *
- * Revision 1.3 1993/12/29 04:40:47 robertj
- * Mac port.
- *
- * Revision 1.2 1993/12/01 16:09:05 robertj
- * Windows NT port.
- *
- * Revision 1.1 1993/10/16 20:33:20 robertj
- * Initial revision
- *
- */
- #define _PPICT
- #ifdef __GNUC__
- #pragma interface
- #endif
- class PPictBase;
- /**This class is used to represent a picture image. It works in conjuction with
- the Ref{PPictBase} class using the "smart" pointer system.
-
- A picture image is one for which a set of drawing commands is stored and
- rendered. This gives very low memory usage and the ability to scale the
- image to any size. However, complex images such as photographs are not
- representable by this format. The alternative is to use a
- Ref{PPixelImage} which stores each pixel individually.
- A common use for images is by the Ref{PMemoryCanvas} class for drawing to
- off screen memory.
- */
- class PPictImage : public PImage {
- PSMART_POINTER_INFO(PPictImage, PImage, PPictBase);
- public:
- /**Create a picture drawing. The picture image may then be drawn
- into via a Ref{PMemoryCanvas} instance.
- */
- PPictImage(PPictBase * obj = NULL);
- /**Create a picture drawing, loading it from the applications resources.
- There is no platform independent way to create these resources but this
- function is provided if needed by an application and the author is
- willing to provide the resources manually.
- */
- PPictImage(
- PRESOURCE_ID resID /// Unique identifier for picture image resource.
- );
- /**Create a picture drawing, reading the picture from the file in a
- platform specific format. For example, under MS-Windows this would read
- a ".WMF" file format.
- */
- PPictImage(
- PFile & dwg /// File to read picture image from.
- );
- };
- class PPictBase : public PImageBase
- {
- PCLASSINFO(PPictBase, PImageBase)
- /* A class representing a graphic drawing shape that is a picture image.
- This is used in conjuction with the Ref{PPictImage} class using the
- "smart" pointer system.
- A picture image is one for which a set of drawing commands is stored and
- rendered. This gives very low memory usage and the ability to scale the
- image to any size. However, complex images such as photographs are not
- representable by this format. The alternative is to use a Ref{PPixelImage}
- which stores each pixel individually.
- */
- protected:
- /**Create an empty picture drawing. The picture image may then be drawn
- into via a Ref{PMemoryCanvas} instance.
- */
- PPictBase();
- /**Create a picture drawing, loading it from the applications resources.
- There is no platform independent way to create these resources but this
- function is provided if needed by an application and the author is
- willing to provide the resources manually.
- */
- PPictBase(
- PRESOURCE_ID resID /// Unique identifier for picture image resource.
- );
-
- /**Create a picture drawing, reading the picture from the file in a
- platform specific format. For example, under MS-Windows this would read
- a ".WMF" file format.
- */
- PPictBase(
- PFile & dwg /// File to read picture image from.
- );
- /** Destroy the picture and its internal storage. */
- ~PPictBase();
- public:
- /**@name Overrides from class PObject */
- /**Determine if the two picture images are the same. Note that this is
- different from having two picture images that merely {bf look} the
- same. They must be references to the same picture image file or if
- loaded from resources, the same resource ID.
- @return
- #EqualTo# if reference the same picture image,
- #GreaterThan# if different.
- */
- virtual Comparison Compare(
- const PObject & obj /// Another picture image to compare against.
- ) const;
- /**@name Overrides from class PImage */
- /**Save the picture drawing into the specified file in platform specific
- format. For example, under MS-Windows this would write a ".WMF" file
- format.
- */
- virtual BOOL Write(
- PFile & dwg /// File to write the picture image to.
- );
- friend class PPictImage;
-
- #ifdef DOC_PLUS_PLUS
- };
- #endif
- // Class declaration continued in platform specific header file ///////////////