| 1 | /* $Id: iPictureEmf.cpp,v 1.1 1999-11-23 20:45:24 davidr Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * OLE Picture Enhanced 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 | // Enhanced Metafile Picture
|
|---|
| 19 | // ----------------------------------------------------------------------
|
|---|
| 20 |
|
|---|
| 21 | IPictureEmf::IPictureEmf(IPictureImpl * a_pPicture, HENHMETAFILE hemf)
|
|---|
| 22 | : IPictureStrat(a_pPicture)
|
|---|
| 23 | {
|
|---|
| 24 | pPicture->u.emf.hemf = hemf;
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | IPictureEmf::~IPictureEmf()
|
|---|
| 28 | {
|
|---|
| 29 | if (pPicture->fOwn)
|
|---|
| 30 | {
|
|---|
| 31 | // Free metafile...
|
|---|
| 32 | DeleteEnhMetaFile(pPicture->u.emf.hemf);
|
|---|
| 33 | }
|
|---|
| 34 | }
|
|---|
| 35 |
|
|---|
| 36 | HRESULT IPictureEmf::get_Handle(OLE_HANDLE * pHandle)
|
|---|
| 37 | {
|
|---|
| 38 | *pHandle = pPicture->u.emf.hemf;
|
|---|
| 39 | return S_OK;
|
|---|
| 40 | }
|
|---|
| 41 |
|
|---|
| 42 | HRESULT IPictureEmf::get_hPal(OLE_HANDLE * phPal)
|
|---|
| 43 | {
|
|---|
| 44 | *phPal = 0;
|
|---|
| 45 | return S_OK;
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | HRESULT IPictureEmf::get_Type(SHORT * pType)
|
|---|
| 49 | {
|
|---|
| 50 | *pType = PICTYPE_ENHMETAFILE;
|
|---|
| 51 | return S_OK;
|
|---|
| 52 | }
|
|---|
| 53 |
|
|---|
| 54 | HRESULT IPictureEmf::get_Width(OLE_XSIZE_HIMETRIC * pWidth)
|
|---|
| 55 | {
|
|---|
| 56 | *pWidth = 0;
|
|---|
| 57 | return E_FAIL;
|
|---|
| 58 | }
|
|---|
| 59 |
|
|---|
| 60 | HRESULT IPictureEmf::get_Height(OLE_YSIZE_HIMETRIC * pHeight)
|
|---|
| 61 | {
|
|---|
| 62 | *pHeight = 0;
|
|---|
| 63 | return E_FAIL;
|
|---|
| 64 | }
|
|---|
| 65 |
|
|---|
| 66 | HRESULT IPictureEmf::Render(HDC hdc, LONG x, LONG y, LONG cx, LONG cy,
|
|---|
| 67 | OLE_XPOS_HIMETRIC xSrc, OLE_YPOS_HIMETRIC ySrc,
|
|---|
| 68 | OLE_XSIZE_HIMETRIC cxSrc, OLE_YSIZE_HIMETRIC cySrc,
|
|---|
| 69 | LPCRECT pRcWBounds)
|
|---|
| 70 | {
|
|---|
| 71 | return E_FAIL;
|
|---|
| 72 | }
|
|---|
| 73 |
|
|---|
| 74 | HRESULT IPictureEmf::set_hPal(OLE_HANDLE hPal)
|
|---|
| 75 | {
|
|---|
| 76 | return E_FAIL;
|
|---|
| 77 | }
|
|---|
| 78 |
|
|---|
| 79 | HRESULT IPictureEmf::SaveAsFile(LPSTREAM pStream, BOOL fSaveMemCopy, LONG * pCbSize)
|
|---|
| 80 | {
|
|---|
| 81 | return E_FAIL;
|
|---|
| 82 | }
|
|---|
| 83 |
|
|---|
| 84 | HRESULT IPictureEmf::get_Attributes(DWORD * pDwAttr)
|
|---|
| 85 | {
|
|---|
| 86 | *pDwAttr = PICTURE_SCALEABLE | PICTURE_TRANSPARENT;
|
|---|
| 87 | return S_OK;
|
|---|
| 88 | }
|
|---|
| 89 |
|
|---|