Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
8a5eb4de
Commit
8a5eb4de
authored
Mar 27, 1999
by
Huw D M Davies
Committed by
Alexandre Julliard
Mar 27, 1999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed metafile recording of CreatePatternBrush.
parent
60935ec3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
37 deletions
+43
-37
metafile.c
objects/metafile.c
+43
-37
No files found.
objects/metafile.c
View file @
8a5eb4de
...
...
@@ -1357,57 +1357,63 @@ BOOL MF_CreateBrushIndirect(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
BOOL
MF_CreatePatternBrush
(
DC
*
dc
,
HBRUSH16
hBrush
,
LOGBRUSH16
*
logbrush
)
{
DWORD
len
,
bmSize
,
biSize
;
HGLOBAL16
hmr
;
METARECORD
*
mr
;
BITMAPOBJ
*
bmp
;
BITMAPINFO
*
info
;
BITMAPINFOHEADER
*
infohdr
;
int
index
;
char
buffer
[
sizeof
(
METARECORD
)];
switch
(
logbrush
->
lbStyle
)
{
case
BS_PATTERN
:
bmp
=
(
BITMAPOBJ
*
)
GDI_GetObjPtr
((
HGDIOBJ16
)
logbrush
->
lbHatch
,
BITMAP_MAGIC
);
if
(
!
bmp
)
return
FALSE
;
len
=
sizeof
(
METARECORD
)
+
sizeof
(
BITMAPINFOHEADER
)
+
(
bmp
->
bitmap
.
bmHeight
*
bmp
->
bitmap
.
bmWidthBytes
)
+
6
;
if
(
!
(
hmr
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
len
)))
{
GDI_HEAP_UNLOCK
((
HGDIOBJ16
)
logbrush
->
lbHatch
);
return
FALSE
;
}
mr
=
(
METARECORD
*
)
GlobalLock16
(
hmr
);
memset
(
mr
,
0
,
len
);
mr
->
rdFunction
=
META_DIBCREATEPATTERNBRUSH
;
mr
->
rdSize
=
len
/
2
;
*
(
mr
->
rdParm
)
=
logbrush
->
lbStyle
;
*
(
mr
->
rdParm
+
1
)
=
DIB_RGB_COLORS
;
infohdr
=
(
BITMAPINFOHEADER
*
)(
mr
->
rdParm
+
2
);
infohdr
->
biSize
=
sizeof
(
BITMAPINFOHEADER
);
infohdr
->
biWidth
=
bmp
->
bitmap
.
bmWidth
;
infohdr
->
biHeight
=
bmp
->
bitmap
.
bmHeight
;
infohdr
->
biPlanes
=
bmp
->
bitmap
.
bmPlanes
;
infohdr
->
biBitCount
=
bmp
->
bitmap
.
bmBitsPixel
;
memcpy
(
mr
->
rdParm
+
(
sizeof
(
BITMAPINFOHEADER
)
/
2
)
+
4
,
PTR_SEG_TO_LIN
(
bmp
->
bitmap
.
bmBits
),
bmp
->
bitmap
.
bmHeight
*
bmp
->
bitmap
.
bmWidthBytes
);
GDI_HEAP_UNLOCK
(
logbrush
->
lbHatch
);
break
;
{
BITMAP
bm
;
BYTE
*
bits
;
GetObjectA
(
logbrush
->
lbHatch
,
sizeof
(
bm
),
&
bm
);
if
(
bm
.
bmBitsPixel
!=
1
||
bm
.
bmPlanes
!=
1
)
{
FIXME
(
metafile
,
"Trying to store a colour pattern brush
\n
"
);
return
FALSE
;
}
bmSize
=
bm
.
bmHeight
*
DIB_GetDIBWidthBytes
(
bm
.
bmWidth
,
1
);
len
=
sizeof
(
METARECORD
)
+
sizeof
(
WORD
)
+
sizeof
(
BITMAPINFO
)
+
sizeof
(
RGBQUAD
)
+
bmSize
;
mr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
if
(
!
mr
)
return
FALSE
;
mr
->
rdFunction
=
META_DIBCREATEPATTERNBRUSH
;
mr
->
rdSize
=
len
/
2
;
mr
->
rdParm
[
0
]
=
BS_PATTERN
;
mr
->
rdParm
[
1
]
=
DIB_RGB_COLORS
;
info
=
(
BITMAPINFO
*
)(
mr
->
rdParm
+
2
);
info
->
bmiHeader
.
biSize
=
sizeof
(
BITMAPINFOHEADER
);
info
->
bmiHeader
.
biWidth
=
bm
.
bmWidth
;
info
->
bmiHeader
.
biHeight
=
bm
.
bmHeight
;
info
->
bmiHeader
.
biPlanes
=
1
;
info
->
bmiHeader
.
biBitCount
=
1
;
bits
=
((
BYTE
*
)
info
)
+
sizeof
(
BITMAPINFO
)
+
sizeof
(
RGBQUAD
);
GetDIBits
(
dc
->
hSelf
,
logbrush
->
lbHatch
,
0
,
bm
.
bmHeight
,
bits
,
info
,
DIB_RGB_COLORS
);
*
(
DWORD
*
)
info
->
bmiColors
=
0
;
*
(
DWORD
*
)(
info
->
bmiColors
+
1
)
=
0xffffff
;
break
;
}
case
BS_DIBPATTERN
:
info
=
(
BITMAPINFO
*
)
GlobalLock16
((
HGLOBAL16
)
logbrush
->
lbHatch
);
if
(
info
->
bmiHeader
.
biCompression
)
bmSize
=
info
->
bmiHeader
.
biSizeImage
;
else
bmSize
=
(
info
->
bmiHeader
.
biWidth
*
info
->
bmiHeader
.
biBitCount
+
31
)
/
32
*
8
*
info
->
bmiHeader
.
biHeight
;
bmSize
=
DIB_GetDIBWidthBytes
(
info
->
bmiHeader
.
biWidth
,
info
->
bmiHeader
.
biBitCount
)
*
info
->
bmiHeader
.
biHeight
;
biSize
=
DIB_BitmapInfoSize
(
info
,
LOWORD
(
logbrush
->
lbColor
));
len
=
sizeof
(
METARECORD
)
+
biSize
+
bmSize
+
2
;
if
(
!
(
hmr
=
GlobalAlloc16
(
GMEM_MOVEABLE
,
len
)))
return
FALSE
;
mr
=
(
METARECORD
*
)
GlobalLock16
(
hmr
);
memset
(
mr
,
0
,
len
);
mr
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
len
);
if
(
!
mr
)
return
FALSE
;
mr
->
rdFunction
=
META_DIBCREATEPATTERNBRUSH
;
mr
->
rdSize
=
len
/
2
;
*
(
mr
->
rdParm
)
=
logbrush
->
lbStyle
;
...
...
@@ -1419,11 +1425,11 @@ BOOL MF_CreatePatternBrush(DC *dc, HBRUSH16 hBrush, LOGBRUSH16 *logbrush)
}
if
(
!
(
MF_WriteRecord
(
dc
,
mr
,
len
)))
{
GlobalFree16
(
h
mr
);
HeapFree
(
GetProcessHeap
(),
0
,
mr
);
return
FALSE
;
}
GlobalFree16
(
h
mr
);
HeapFree
(
GetProcessHeap
(),
0
,
mr
);
mr
=
(
METARECORD
*
)
&
buffer
;
mr
->
rdSize
=
sizeof
(
METARECORD
)
/
2
;
...
...
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