Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8bf41d88
Commit
8bf41d88
authored
May 28, 2007
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
May 29, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Add support for loading and drawing metafiles.
parent
6aa84e0e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
1 deletion
+53
-1
olepicture.c
dlls/oleaut32/olepicture.c
+53
-1
No files found.
dlls/oleaut32/olepicture.c
View file @
8bf41d88
...
@@ -674,7 +674,16 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
...
@@ -674,7 +674,16 @@ static HRESULT WINAPI OLEPictureImpl_Render(IPicture *iface, HDC hdc,
break
;
break
;
case
PICTYPE_METAFILE
:
case
PICTYPE_METAFILE
:
PlayMetaFile
(
hdc
,
This
->
desc
.
u
.
wmf
.
hmeta
);
break
;
case
PICTYPE_ENHMETAFILE
:
case
PICTYPE_ENHMETAFILE
:
{
RECT
rc
=
{
x
,
y
,
cx
,
cy
};
PlayEnhMetaFile
(
hdc
,
This
->
desc
.
u
.
emf
.
hemf
,
&
rc
);
break
;
}
default:
default:
FIXME
(
"type %d not implemented
\n
"
,
This
->
desc
.
picType
);
FIXME
(
"type %d not implemented
\n
"
,
This
->
desc
.
picType
);
return
E_NOTIMPL
;
return
E_NOTIMPL
;
...
@@ -795,6 +804,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
...
@@ -795,6 +804,7 @@ static HRESULT WINAPI OLEPictureImpl_get_Attributes(IPicture *iface,
switch
(
This
->
desc
.
picType
)
{
switch
(
This
->
desc
.
picType
)
{
case
PICTYPE_BITMAP
:
if
(
This
->
hbmMask
)
*
pdwAttr
=
PICTURE_TRANSPARENT
;
break
;
/* not 'truly' scalable, see MSDN. */
case
PICTYPE_BITMAP
:
if
(
This
->
hbmMask
)
*
pdwAttr
=
PICTURE_TRANSPARENT
;
break
;
/* not 'truly' scalable, see MSDN. */
case
PICTYPE_ICON
:
*
pdwAttr
=
PICTURE_TRANSPARENT
;
break
;
case
PICTYPE_ICON
:
*
pdwAttr
=
PICTURE_TRANSPARENT
;
break
;
case
PICTYPE_ENHMETAFILE
:
/* fall through */
case
PICTYPE_METAFILE
:
*
pdwAttr
=
PICTURE_TRANSPARENT
|
PICTURE_SCALABLE
;
break
;
case
PICTYPE_METAFILE
:
*
pdwAttr
=
PICTURE_TRANSPARENT
|
PICTURE_SCALABLE
;
break
;
default:
FIXME
(
"Unknown pictype %d
\n
"
,
This
->
desc
.
picType
);
break
;
default:
FIXME
(
"Unknown pictype %d
\n
"
,
This
->
desc
.
picType
);
break
;
}
}
...
@@ -1385,6 +1395,43 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
...
@@ -1385,6 +1395,43 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
}
}
}
}
static
HRESULT
OLEPictureImpl_LoadMetafile
(
OLEPictureImpl
*
This
,
const
BYTE
*
data
,
ULONG
size
)
{
HMETAFILE
hmf
;
HENHMETAFILE
hemf
;
/* SetMetaFileBitsEx performs data check on its own */
hmf
=
SetMetaFileBitsEx
(
size
,
data
);
if
(
hmf
)
{
This
->
desc
.
picType
=
PICTYPE_METAFILE
;
This
->
desc
.
u
.
wmf
.
hmeta
=
hmf
;
This
->
desc
.
u
.
wmf
.
xExt
=
0
;
This
->
desc
.
u
.
wmf
.
yExt
=
0
;
This
->
origWidth
=
0
;
This
->
origHeight
=
0
;
This
->
himetricWidth
=
0
;
This
->
himetricHeight
=
0
;
return
S_OK
;
}
hemf
=
SetEnhMetaFileBits
(
size
,
data
);
if
(
!
hemf
)
return
E_FAIL
;
This
->
desc
.
picType
=
PICTYPE_ENHMETAFILE
;
This
->
desc
.
u
.
emf
.
hemf
=
hemf
;
This
->
origWidth
=
0
;
This
->
origHeight
=
0
;
This
->
himetricWidth
=
0
;
This
->
himetricHeight
=
0
;
return
S_OK
;
}
/************************************************************************
/************************************************************************
* OLEPictureImpl_IPersistStream_Load (IUnknown)
* OLEPictureImpl_IPersistStream_Load (IUnknown)
*
*
...
@@ -1393,7 +1440,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
...
@@ -1393,7 +1440,7 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
* DWORD magic;
* DWORD magic;
* DWORD len;
* DWORD len;
*
*
* Currently implemented: BITMAP, ICON, JPEG, GIF
* Currently implemented: BITMAP, ICON, JPEG, GIF
, WMF, EMF
*/
*/
static
HRESULT
WINAPI
OLEPictureImpl_Load
(
IPersistStream
*
iface
,
IStream
*
pStm
)
{
static
HRESULT
WINAPI
OLEPictureImpl_Load
(
IPersistStream
*
iface
,
IStream
*
pStm
)
{
HRESULT
hr
=
E_FAIL
;
HRESULT
hr
=
E_FAIL
;
...
@@ -1544,6 +1591,11 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
...
@@ -1544,6 +1591,11 @@ static HRESULT WINAPI OLEPictureImpl_Load(IPersistStream* iface,IStream*pStm) {
default:
default:
{
{
unsigned
int
i
;
unsigned
int
i
;
/* let's see if it's a metafile */
hr
=
OLEPictureImpl_LoadMetafile
(
This
,
xbuf
,
xread
);
if
(
hr
==
S_OK
)
break
;
FIXME
(
"Unknown magic %04x, %d read bytes:
\n
"
,
magic
,
xread
);
FIXME
(
"Unknown magic %04x, %d read bytes:
\n
"
,
magic
,
xread
);
hr
=
E_FAIL
;
hr
=
E_FAIL
;
for
(
i
=
0
;
i
<
xread
+
8
;
i
++
)
{
for
(
i
=
0
;
i
<
xread
+
8
;
i
++
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment