4 * Metafile pixture image.
6 * Portable Windows Library
8 * Copyright (c) 1993-1998 Equivalence Pty. Ltd.
10 * The contents of this file are subject to the Mozilla Public License
11 * Version 1.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.mozilla.org/MPL/
15 * Software distributed under the License is distributed on an "AS IS"
16 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17 * the License for the specific language governing rights and limitations
20 * The Original Code is Portable Windows Library.
22 * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
25 * All Rights Reserved.
27 * Contributor(s): ______________________________________.
30 * Revision 1.20 2001/05/22 12:49:33 robertj
31 * Did some seriously wierd rewrite of platform headers to eliminate the
32 * stupid GNU compiler warning about braces not matching.
34 * Revision 1.19 1999/08/24 06:54:36 robertj
35 * Cleaned up the smart pointer code (macros).
37 * Revision 1.18 1999/03/10 03:49:52 robertj
38 * More documentation adjustments.
40 * Revision 1.17 1999/03/09 08:01:49 robertj
41 * Changed comments for doc++ support (more to come).
43 * Revision 1.16 1999/02/16 08:08:46 robertj
44 * MSVC 6.0 compatibility changes.
46 * Revision 1.15 1998/09/23 06:27:59 robertj
47 * Added open source copyright license.
49 * Revision 1.14 1995/03/14 12:42:01 robertj
50 * Updated documentation to use HTML codes.
52 * Revision 1.13 1995/01/09 12:38:56 robertj
55 * Revision 1.12 1994/12/12 10:04:44 robertj
56 * Renamed PWrapper to PSmartPointer.
58 * Revision 1.11 1994/12/05 11:34:11 robertj
59 * Major rewrite of images, pictures and pixmaps.
60 * Renamed PPict, PPixels and PImage to make sure all uses are found.
62 * Revision 1.10 1994/10/23 04:50:13 robertj
63 * Changed Save to Write to better match Read function.
65 * Revision 1.9 1994/08/23 11:32:52 robertj
68 * Revision 1.8 1994/08/22 00:46:48 robertj
69 * Added pragma fro GNU C++ compiler.
71 * Revision 1.7 1994/06/25 11:55:15 robertj
72 * Unix version synchronisation.
74 * Revision 1.6 1994/04/03 08:34:18 robertj
75 * Added help and focus functionality.
77 * Revision 1.5 1994/01/03 04:42:23 robertj
78 * Mass changes to common container classes and interactors etc etc etc.
80 * Revision 1.4 1993/12/31 06:45:38 robertj
81 * Made inlines optional for debugging purposes.
83 * Revision 1.3 1993/12/29 04:40:47 robertj
86 * Revision 1.2 1993/12/01 16:09:05 robertj
89 * Revision 1.1 1993/10/16 20:33:20 robertj
104 /**This class is used to represent a picture image. It works in conjuction with
105 the \Ref{PPictBase} class using the "smart" pointer system.
107 A picture image is one for which a set of drawing commands is stored and
108 rendered. This gives very low memory usage and the ability to scale the
109 image to any size. However, complex images such as photographs are not
110 representable by this format. The alternative is to use a
111 \Ref{PPixelImage} which stores each pixel individually.
113 A common use for images is by the \Ref{PMemoryCanvas} class for drawing to
116 class PPictImage
: public PImage
{
117 PSMART_POINTER_INFO(PPictImage
, PImage
, PPictBase
);
119 /**Create a picture drawing. The picture image may then be drawn
120 into via a \Ref{PMemoryCanvas} instance.
122 PPictImage(PPictBase
* obj
= NULL
);
124 /**Create a picture drawing, loading it from the applications resources.
125 There is no platform independent way to create these resources but this
126 function is provided if needed by an application and the author is
127 willing to provide the resources manually.
130 PRESOURCE_ID resID
/// Unique identifier for picture image resource.
133 /**Create a picture drawing, reading the picture from the file in a
134 platform specific format. For example, under MS-Windows this would read
135 a ".WMF" file format.
138 PFile
& dwg
/// File to read picture image from.
143 class PPictBase
: public PImageBase
145 PCLASSINFO(PPictBase
, PImageBase
)
146 /* A class representing a graphic drawing shape that is a picture image.
147 This is used in conjuction with the \Ref{PPictImage} class using the
148 "smart" pointer system.
150 A picture image is one for which a set of drawing commands is stored and
151 rendered. This gives very low memory usage and the ability to scale the
152 image to any size. However, complex images such as photographs are not
153 representable by this format. The alternative is to use a \Ref{PPixelImage}
154 which stores each pixel individually.
158 /**Create an empty picture drawing. The picture image may then be drawn
159 into via a \Ref{PMemoryCanvas} instance.
163 /**Create a picture drawing, loading it from the applications resources.
164 There is no platform independent way to create these resources but this
165 function is provided if needed by an application and the author is
166 willing to provide the resources manually.
169 PRESOURCE_ID resID
/// Unique identifier for picture image resource.
172 /**Create a picture drawing, reading the picture from the file in a
173 platform specific format. For example, under MS-Windows this would read
174 a ".WMF" file format.
177 PFile
& dwg
/// File to read picture image from.
180 /** Destroy the picture and its internal storage. */
185 /**@name Overrides from class PObject */
186 /**Determine if the two picture images are the same. Note that this is
187 different from having two picture images that merely {\bf look} the
188 same. They must be references to the same picture image file or if
189 loaded from resources, the same resource ID.
192 #EqualTo# if reference the same picture image,
193 #GreaterThan# if different.
195 virtual Comparison
Compare(
196 const PObject
& obj
/// Another picture image to compare against.
200 /**@name Overrides from class PImage */
201 /**Save the picture drawing into the specified file in platform specific
202 format. For example, under MS-Windows this would write a ".WMF" file
206 PFile
& dwg
/// File to write the picture image to.
210 friend class PPictImage
;
214 // Include platform dependent part of class
215 #include <pwlib/pict.h>
219 // End Of File ///////////////////////////////////////////////////////////////