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
e7b5e698
Commit
e7b5e698
authored
Aug 15, 2012
by
Dmitry Timoshkov
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Properly convert source coordinates to device units in GdipDrawImagePointsRect.
parent
938d42c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
28 deletions
+15
-28
graphics.c
dlls/gdiplus/graphics.c
+15
-28
No files found.
dlls/gdiplus/graphics.c
View file @
e7b5e698
...
...
@@ -3040,7 +3040,6 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
{
GpPointF
ptf
[
4
];
POINT
pti
[
4
];
REAL
dx
,
dy
;
GpStatus
stat
;
TRACE
(
"(%p, %p, %p, %d, %f, %f, %f, %f, %d, %p, %p, %p)
\n
"
,
graphics
,
image
,
points
,
...
...
@@ -3063,6 +3062,15 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
return
Ok
;
transform_and_round_points
(
graphics
,
pti
,
ptf
,
4
);
TRACE
(
"%s %s %s %s
\n
"
,
wine_dbgstr_point
(
&
pti
[
0
]),
wine_dbgstr_point
(
&
pti
[
1
]),
wine_dbgstr_point
(
&
pti
[
2
]),
wine_dbgstr_point
(
&
pti
[
3
]));
srcx
=
units_to_pixels
(
srcx
,
srcUnit
,
image
->
xres
);
srcy
=
units_to_pixels
(
srcy
,
srcUnit
,
image
->
yres
);
srcwidth
=
units_to_pixels
(
srcwidth
,
srcUnit
,
image
->
xres
);
srcheight
=
units_to_pixels
(
srcheight
,
srcUnit
,
image
->
yres
);
TRACE
(
"src pixels: %f,%f %fx%f
\n
"
,
srcx
,
srcy
,
srcwidth
,
srcheight
);
if
(
image
->
picture
)
{
if
(
!
graphics
->
hdc
)
...
...
@@ -3070,23 +3078,10 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
FIXME
(
"graphics object has no HDC
\n
"
);
}
/* FIXME: partially implemented (only works for rectangular parallelograms) */
if
(
srcUnit
==
UnitInch
)
dx
=
dy
=
(
REAL
)
INCH_HIMETRIC
;
else
if
(
srcUnit
==
UnitPixel
){
dx
=
((
REAL
)
INCH_HIMETRIC
)
/
((
REAL
)
GetDeviceCaps
(
graphics
->
hdc
,
LOGPIXELSX
));
dy
=
((
REAL
)
INCH_HIMETRIC
)
/
((
REAL
)
GetDeviceCaps
(
graphics
->
hdc
,
LOGPIXELSY
));
}
else
return
NotImplemented
;
if
(
IPicture_Render
(
image
->
picture
,
graphics
->
hdc
,
pti
[
0
].
x
,
pti
[
0
].
y
,
pti
[
1
].
x
-
pti
[
0
].
x
,
pti
[
2
].
y
-
pti
[
0
].
y
,
srcx
*
dx
,
srcy
*
dy
,
srcwidth
*
dx
,
srcheight
*
dy
,
NULL
)
!=
S_OK
){
srcx
,
srcy
,
srcwidth
,
srcheight
,
NULL
)
!=
S_OK
)
{
if
(
callback
)
callback
(
callbackData
);
return
GenericError
;
...
...
@@ -3097,18 +3092,6 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
GpBitmap
*
bitmap
=
(
GpBitmap
*
)
image
;
int
use_software
=
0
;
if
(
srcUnit
==
UnitInch
)
dx
=
dy
=
96
.
0
;
/* FIXME: use the image resolution */
else
if
(
srcUnit
==
UnitPixel
)
dx
=
dy
=
1
.
0
;
else
return
NotImplemented
;
srcx
=
srcx
*
dx
;
srcy
=
srcy
*
dy
;
srcwidth
=
srcwidth
*
dx
;
srcheight
=
srcheight
*
dy
;
if
(
imageAttributes
||
(
graphics
->
image
&&
graphics
->
image
->
type
==
ImageTypeBitmap
)
||
!
((
GpBitmap
*
)
image
)
->
hbitmap
||
...
...
@@ -3145,6 +3128,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
if
(
dst_area
.
bottom
<
pti
[
i
].
y
)
dst_area
.
bottom
=
pti
[
i
].
y
;
}
TRACE
(
"dst_area: %s
\n
"
,
wine_dbgstr_rect
(
&
dst_area
));
m11
=
(
ptf
[
1
].
X
-
ptf
[
0
].
X
)
/
srcwidth
;
m21
=
(
ptf
[
2
].
X
-
ptf
[
0
].
X
)
/
srcheight
;
mdx
=
ptf
[
0
].
X
-
m11
*
srcx
-
m21
*
srcy
;
...
...
@@ -3174,6 +3159,8 @@ GpStatus WINGDIPAPI GdipDrawImagePointsRect(GpGraphics *graphics, GpImage *image
get_bitmap_sample_size
(
interpolation
,
imageAttributes
->
wrap
,
bitmap
,
srcx
,
srcy
,
srcwidth
,
srcheight
,
&
src_area
);
TRACE
(
"src_area: %d x %d
\n
"
,
src_area
.
Width
,
src_area
.
Height
);
src_data
=
GdipAlloc
(
sizeof
(
ARGB
)
*
src_area
.
Width
*
src_area
.
Height
);
if
(
!
src_data
)
{
...
...
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