1 | /* $Id: iPictureMeta.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
|
---|
2 | /*
|
---|
3 | * OLE Picture Metafile Strategy object
|
---|
4 | *
|
---|
5 | * 20/11/99 - New Code
|
---|
6 | *
|
---|
7 | * Copyright 1999 David J. Raison
|
---|
8 | *
|
---|
9 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
10 | *
|
---|
11 | */
|
---|
12 |
|
---|
13 | #include "oleaut32.h"
|
---|
14 | #include "olectl.h"
|
---|
15 | #include "ipicture.h"
|
---|
16 |
|
---|
17 | // ----------------------------------------------------------------------
|
---|
18 | // Std Metafile Picture
|
---|
19 | // ----------------------------------------------------------------------
|
---|
20 |
|
---|
21 | IPictureMeta::IPictureMeta(IPictureImpl * a_pPicture, HMETAFILE hmeta, int xExt, int yExt)
|
---|
22 | : IPictureStrat(a_pPicture)
|
---|
23 | {
|
---|
24 | pPicture->u.wmf.hmeta = hmeta;
|
---|
25 | pPicture->u.wmf.xExt = xExt;
|
---|
26 | pPicture->u.wmf.yExt = yExt;
|
---|
27 | }
|
---|
28 |
|
---|
29 | IPictureMeta::~IPictureMeta()
|
---|
30 | {
|
---|
31 | if (pPicture->fOwn)
|
---|
32 | {
|
---|
33 | // Free metafile...
|
---|
34 | DeleteMetaFile(pPicture->u.wmf.hmeta);
|
---|
35 | }
|
---|
36 | }
|
---|
37 |
|
---|
38 | HRESULT IPictureMeta::get_Handle(OLE_HANDLE * pHandle)
|
---|
39 | {
|
---|
40 | *pHandle = pPicture->u.wmf.hmeta;
|
---|
41 | return S_OK;
|
---|
42 | }
|
---|
43 |
|
---|
44 | HRESULT IPictureMeta::get_hPal(OLE_HANDLE * phPal)
|
---|
45 | {
|
---|
46 | *phPal = 0;
|
---|
47 | return E_FAIL;
|
---|
48 | }
|
---|
49 |
|
---|
50 | HRESULT IPictureMeta::get_Type(SHORT * pType)
|
---|
51 | {
|
---|
52 | *pType = PICTYPE_METAFILE;
|
---|
53 | return S_OK;
|
---|
54 | }
|
---|
55 |
|
---|
56 | HRESULT IPictureMeta::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
|
---|
57 | {
|
---|
58 | *pWidth = pPicture->u.wmf.xExt;
|
---|
59 | return S_OK;
|
---|
60 | }
|
---|
61 |
|
---|
62 | HRESULT IPictureMeta::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
|
---|
63 | {
|
---|
64 | *pHeight = pPicture->u.wmf.yExt;
|
---|
65 | return S_OK;
|
---|
66 | }
|
---|
67 |
|
---|
68 | HRESULT IPictureMeta::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
|
---|
69 | OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
|
---|
70 | OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
|
---|
71 | LPCRECT pRcWBounds)
|
---|
72 | {
|
---|
73 | return E_FAIL;
|
---|
74 | }
|
---|
75 |
|
---|
76 | HRESULT IPictureMeta::set_hPal(OLE_HANDLE hPal)
|
---|
77 | {
|
---|
78 | return E_FAIL;
|
---|
79 | }
|
---|
80 |
|
---|
81 | HRESULT IPictureMeta::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
|
---|
82 | {
|
---|
83 | return E_FAIL;
|
---|
84 | }
|
---|
85 |
|
---|
86 | HRESULT IPictureMeta::get_Attributes(DWORD * pDwAttr)
|
---|
87 | {
|
---|
88 | *pDwAttr = PICTURE_SCALEABLE | PICTURE_TRANSPARENT;
|
---|
89 | return S_OK;
|
---|
90 | }
|
---|
91 |
|
---|