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
5cde9607
Commit
5cde9607
authored
Jul 31, 2007
by
Evan Stade
Committed by
Alexandre Julliard
Aug 01, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: Track width and height of GpBitmaps.
parent
fcbb2111
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
78 additions
and
14 deletions
+78
-14
gdiplus_private.h
dlls/gdiplus/gdiplus_private.h
+2
-0
image.c
dlls/gdiplus/image.c
+76
-14
No files found.
dlls/gdiplus/gdiplus_private.h
View file @
5cde9607
...
...
@@ -130,6 +130,8 @@ struct GpMetafile{
struct
GpBitmap
{
GpImage
image
;
INT
width
;
INT
height
;
};
struct
GpImageAttributes
{
...
...
dlls/gdiplus/image.c
View file @
5cde9607
...
...
@@ -36,6 +36,39 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
typedef
void
ImageItemData
;
static
INT
ipicture_pixel_height
(
IPicture
*
pic
)
{
HDC
hdcref
;
OLE_YSIZE_HIMETRIC
y
;
IPicture_get_Height
(
pic
,
&
y
);
hdcref
=
GetDC
(
0
);
y
=
(
UINT
)(((
REAL
)
y
)
*
((
REAL
)
GetDeviceCaps
(
hdcref
,
LOGPIXELSY
))
/
((
REAL
)
INCH_HIMETRIC
));
ReleaseDC
(
0
,
hdcref
);
return
y
;
}
static
INT
ipicture_pixel_width
(
IPicture
*
pic
)
{
HDC
hdcref
;
OLE_XSIZE_HIMETRIC
x
;
IPicture_get_Width
(
pic
,
&
x
);
hdcref
=
GetDC
(
0
);
x
=
(
UINT
)(((
REAL
)
x
)
*
((
REAL
)
GetDeviceCaps
(
hdcref
,
LOGPIXELSX
))
/
((
REAL
)
INCH_HIMETRIC
));
ReleaseDC
(
0
,
hdcref
);
return
x
;
}
GpStatus
WINGDIPAPI
GdipBitmapGetPixel
(
GpBitmap
*
bitmap
,
INT
x
,
INT
y
,
ARGB
*
color
)
{
...
...
@@ -110,6 +143,8 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride,
}
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
(
*
bitmap
)
->
width
=
width
;
(
*
bitmap
)
->
height
=
height
;
return
Ok
;
}
...
...
@@ -121,10 +156,14 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream,
stat
=
GdipLoadImageFromStreamICM
(
stream
,
(
GpImage
**
)
bitmap
);
if
(
stat
==
Ok
)
if
(
stat
!=
Ok
)
return
stat
;
(
*
bitmap
)
->
image
.
type
=
ImageTypeBitmap
;
(
*
bitmap
)
->
width
=
ipicture_pixel_width
((
*
bitmap
)
->
image
.
picture
);
(
*
bitmap
)
->
height
=
ipicture_pixel_height
((
*
bitmap
)
->
image
.
picture
);
return
stat
;
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipDisposeImage
(
GpImage
*
image
)
...
...
@@ -155,25 +194,42 @@ GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect,
memcpy
(
srcRect
,
&
((
GpMetafile
*
)
image
)
->
bounds
,
sizeof
(
GpRectF
));
*
srcUnit
=
((
GpMetafile
*
)
image
)
->
unit
;
}
else
if
(
image
->
type
==
ImageTypeBitmap
){
srcRect
->
X
=
srcRect
->
Y
=
0
.
0
;
srcRect
->
Width
=
(
REAL
)
((
GpBitmap
*
)
image
)
->
width
;
srcRect
->
Height
=
(
REAL
)
((
GpBitmap
*
)
image
)
->
height
;
*
srcUnit
=
UnitPixel
;
}
else
{
FIXME
(
"not implemented for bitmaps
\n
"
);
return
NotImplemented
;
srcRect
->
X
=
srcRect
->
Y
=
0
.
0
;
srcRect
->
Width
=
ipicture_pixel_width
(
image
->
picture
);
srcRect
->
Height
=
ipicture_pixel_height
(
image
->
picture
);
*
srcUnit
=
UnitPixel
;
}
TRACE
(
"returning (%f, %f) (%f, %f) unit type %d
\n
"
,
srcRect
->
X
,
srcRect
->
Y
,
srcRect
->
Width
,
srcRect
->
Height
,
*
srcUnit
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetImageHeight
(
GpImage
*
image
,
UINT
*
height
)
{
static
int
calls
;
if
(
!
image
||
!
height
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
if
(
image
->
type
==
ImageTypeMetafile
){
FIXME
(
"not implemented for metafiles
\n
"
);
return
NotImplemented
;
}
else
if
(
image
->
type
==
ImageTypeBitmap
)
*
height
=
((
GpBitmap
*
)
image
)
->
height
;
else
*
height
=
ipicture_pixel_height
(
image
->
picture
);
TRACE
(
"returning %d
\n
"
,
*
height
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetImageHorizontalResolution
(
GpImage
*
image
,
REAL
*
res
)
...
...
@@ -227,15 +283,21 @@ GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage *image, REAL *res)
GpStatus
WINGDIPAPI
GdipGetImageWidth
(
GpImage
*
image
,
UINT
*
width
)
{
static
int
calls
;
if
(
!
image
||
!
width
)
return
InvalidParameter
;
if
(
!
(
calls
++
))
FIXME
(
"not implemented
\n
"
);
if
(
image
->
type
==
ImageTypeMetafile
){
FIXME
(
"not implemented for metafiles
\n
"
);
return
NotImplemented
;
}
else
if
(
image
->
type
==
ImageTypeBitmap
)
*
width
=
((
GpBitmap
*
)
image
)
->
width
;
else
*
width
=
ipicture_pixel_width
(
image
->
picture
);
TRACE
(
"returning %d
\n
"
,
*
width
);
return
Ok
;
}
GpStatus
WINGDIPAPI
GdipGetMetafileHeaderFromMetafile
(
GpMetafile
*
metafile
,
...
...
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