winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
August 2007
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
3 participants
1085 discussions
Start a n
N
ew thread
Evan Stade : gdiplus: Added GdipCreateBitmapFromStreamICM.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 3ee25cc3dfbe075a9e0b30df1f30fd75432510a4 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3ee25cc3dfbe075a9e0b30df1…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:16:04 2007 -0700 gdiplus: Added GdipCreateBitmapFromStreamICM. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 13 +++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 15 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 4a09aac..fb14d56 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -80,7 +80,7 @@ @ stub GdipCreateBitmapFromResource @ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) @ stub GdipCreateBitmapFromStream -@ stub GdipCreateBitmapFromStreamICM +@ stdcall GdipCreateBitmapFromStreamICM(ptr ptr) @ stub GdipCreateCachedBitmap @ stdcall GdipCreateCustomLineCap(ptr ptr long long ptr) @ stub GdipCreateEffect diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 28d4862..1b986ae 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -97,6 +97,19 @@ GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, return Ok; } +GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream, + GpBitmap **bitmap) +{ + GpStatus stat; + + stat = GdipLoadImageFromStreamICM(stream, (GpImage**) bitmap); + + if(stat == Ok) + (*bitmap)->image.type = ImageTypeBitmap; + + return stat; +} + GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { if(!image) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 809868b..29ff401 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -140,6 +140,7 @@ GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, GpBitmap**); +GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream*,GpBitmap**); GpStatus WINGDIPAPI GdipDisposeImage(GpImage*); GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*); GpStatus WINGDIPAPI GdipGetImageHeight(GpImage*,UINT*);
1
0
0
0
Evan Stade : gdiplus: Added partial implementation of GdipSaveImageToStream .
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 8304765abdd4e5858149ea0c76b327c2f6d15e6f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8304765abdd4e5858149ea0c7…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:16:00 2007 -0700 gdiplus: Added partial implementation of GdipSaveImageToStream. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 13 ++++++++++ include/Makefile.in | 1 + include/gdiplus.h | 2 + include/gdiplusflat.h | 2 + include/gdiplusimaging.h | 56 +++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 26f7dd0..4a09aac 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -495,7 +495,7 @@ @ stub GdipSaveAddImage @ stdcall GdipSaveGraphics(ptr ptr) @ stub GdipSaveImageToFile -@ stub GdipSaveImageToStream +@ stdcall GdipSaveImageToStream(ptr ptr ptr) @ stub GdipScaleLineTransform @ stdcall GdipScaleMatrix(ptr long long long) @ stub GdipScalePathGradientTransform diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 0a164bb..28d4862 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -273,3 +273,16 @@ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) return Ok; } + +GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage *image, IStream* stream, + GDIPCONST CLSID* clsid, GDIPCONST EncoderParameters* params) +{ + if(!image || !stream) + return InvalidParameter; + + /* FIXME: CLSID, EncoderParameters not used */ + + IPicture_SaveAsFile(image->picture, stream, FALSE, NULL); + + return Ok; +} diff --git a/include/Makefile.in b/include/Makefile.in index a79ae12..05dc60e 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -167,6 +167,7 @@ SRCDIR_INCLUDES = \ gdiplusenums.h \ gdiplusflat.h \ gdiplusgpstubs.h \ + gdiplusimaging.h \ gdiplusinit.h \ gdiplusmem.h \ gdiplusmetaheader.h \ diff --git a/include/gdiplus.h b/include/gdiplus.h index 6b42093..1f4ae78 100644 --- a/include/gdiplus.h +++ b/include/gdiplus.h @@ -33,6 +33,7 @@ namespace Gdiplus #include "gdiplusinit.h" #include "gdipluspixelformats.h" #include "gdiplusmetaheader.h" +#include "gdiplusimaging.h" #include "gdiplusgpstubs.h" namespace DllExports @@ -50,6 +51,7 @@ namespace Gdiplus #include "gdiplusinit.h" #include "gdipluspixelformats.h" #include "gdiplusmetaheader.h" +#include "gdiplusimaging.h" #include "gdiplusgpstubs.h" #include "gdiplusflat.h" diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 0fea604..809868b 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -152,6 +152,8 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**); +GpStatus WINGDIPAPI GdipSaveImageToStream(GpImage*,IStream*, + GDIPCONST CLSID*,GDIPCONST EncoderParameters*); GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**); GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*); diff --git a/include/gdiplusimaging.h b/include/gdiplusimaging.h new file mode 100644 index 0000000..c76aba5 --- /dev/null +++ b/include/gdiplusimaging.h @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2007 Google (Evan Stade) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef _GDIPLUSIMAGING_H +#define _GDIPLUSIMAGING_H + +#ifdef __cplusplus +class EncoderParameter +{ +public: + GUID Guid; + ULONG NumberOfValues; + ULONG Type; + VOID* Value; +}; + +class EncoderParameters +{ +public: + UINT Count; + EncoderParameter Parameter[1]; +}; +#else /* end of c++ typedefs */ + +typedef struct EncoderParameter +{ + GUID Guid; + ULONG NumberOfValues; + ULONG Type; + VOID* Value; +} EncoderParameter; + +typedef struct EncoderParameters +{ + UINT Count; + EncoderParameter Parameter[1]; +} EncoderParameters; + +#endif /* end of c typedefs */ + +#endif /* _GDIPLUSIMAGING_H */
1
0
0
0
Evan Stade : gdiplus: Added GdipGetPropertyItemSize stub.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 6394e315cf49e4727857214879f64c82269c6bef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6394e315cf49e472785721487…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:56 2007 -0700 gdiplus: Added GdipGetPropertyItemSize stub. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 16 ++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 2660c71..26f7dd0 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -373,7 +373,7 @@ @ stub GdipGetPropertyCount @ stub GdipGetPropertyIdList @ stub GdipGetPropertyItem -@ stub GdipGetPropertyItemSize +@ stdcall GdipGetPropertyItemSize(ptr long ptr) @ stub GdipGetPropertySize @ stub GdipGetRegionBounds @ stub GdipGetRegionBoundsI diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 6e78308..0a164bb 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -222,6 +222,22 @@ GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, return NotImplemented; } +GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage *image, PROPID pid, + UINT* size) +{ + static int calls; + + TRACE("%p %x %p\n", image, pid, size); + + if(!size || !image) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID* dimensionID, UINT* count) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 4ed1011..0fea604 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -149,6 +149,7 @@ GpStatus WINGDIPAPI GdipGetImageType(GpImage*,ImageType*); GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); +GpStatus WINGDIPAPI GdipGetPropertyItemSize(GpImage*,PROPID,UINT*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**);
1
0
0
0
Evan Stade : gdiplus: Added GdipCreateBitmapFromScan0.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 9fa4c1248667aa23b88323fbf087e42f547f7ae1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9fa4c1248667aa23b88323fbf…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:52 2007 -0700 gdiplus: Added GdipCreateBitmapFromScan0. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/gdiplus_private.h | 4 ++ dlls/gdiplus/image.c | 62 ++++++++++++++++++++++++++++++++++++++++ include/gdiplusflat.h | 2 + include/gdiplusgpstubs.h | 2 + include/gdipluspixelformats.h | 1 + 6 files changed, 72 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 0b57027..2660c71 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -78,7 +78,7 @@ @ stub GdipCreateBitmapFromHBITMAP @ stub GdipCreateBitmapFromHICON @ stub GdipCreateBitmapFromResource -@ stub GdipCreateBitmapFromScan0 +@ stdcall GdipCreateBitmapFromScan0(long long long long ptr ptr) @ stub GdipCreateBitmapFromStream @ stub GdipCreateBitmapFromStreamICM @ stub GdipCreateCachedBitmap diff --git a/dlls/gdiplus/gdiplus_private.h b/dlls/gdiplus/gdiplus_private.h index c31de0e..602ca2c 100644 --- a/dlls/gdiplus/gdiplus_private.h +++ b/dlls/gdiplus/gdiplus_private.h @@ -128,6 +128,10 @@ struct GpMetafile{ GpUnit unit; }; +struct GpBitmap{ + GpImage image; +}; + struct GpImageAttributes{ WrapMode wrap; }; diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 00d0a58..6e78308 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -26,6 +26,7 @@ #define COBJMACROS #include "objbase.h" #include "olectl.h" +#include "ole2.h" #include "gdiplus.h" #include "gdiplus_private.h" @@ -35,6 +36,67 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); typedef void ImageItemData; +GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, + PixelFormat format, BYTE* scan0, GpBitmap** bitmap) +{ + BITMAPFILEHEADER *bmfh; + BITMAPINFOHEADER *bmih; + BYTE *buff; + INT datalen = stride * height, size; + IStream *stream; + + TRACE("%d %d %d %d %p %p\n", width, height, stride, format, scan0, bitmap); + + if(!scan0 || !bitmap) + return InvalidParameter; + + *bitmap = GdipAlloc(sizeof(GpBitmap)); + if(!*bitmap) return OutOfMemory; + + size = sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + datalen; + buff = GdipAlloc(size); + if(!buff){ + GdipFree(*bitmap); + return OutOfMemory; + } + + bmfh = (BITMAPFILEHEADER*) buff; + bmih = (BITMAPINFOHEADER*) (bmfh + 1); + + bmfh->bfType = (((WORD)'M') << 8) + (WORD)'B'; + bmfh->bfSize = size; + bmfh->bfOffBits = size - datalen; + + bmih->biSize = sizeof(BITMAPINFOHEADER); + bmih->biWidth = width; + bmih->biHeight = height; + /* FIXME: use the rest of the data from format */ + bmih->biBitCount = format >> 8; + bmih->biCompression = BI_RGB; + + memcpy(bmih + 1, scan0, datalen); + + if(CreateStreamOnHGlobal(buff, TRUE, &stream) != S_OK){ + ERR("could not make stream\n"); + GdipFree(*bitmap); + GdipFree(buff); + return GenericError; + } + + if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, + (LPVOID*) &((*bitmap)->image.picture)) != S_OK){ + TRACE("Could not load picture\n"); + IStream_Release(stream); + GdipFree(*bitmap); + GdipFree(buff); + return GenericError; + } + + (*bitmap)->image.type = ImageTypeBitmap; + + return Ok; +} + GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { if(!image) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 348d7c0..4ed1011 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -138,6 +138,8 @@ GpStatus WINGDIPAPI GdipCreateCustomLineCap(GpPath*,GpPath*,GpLineCap,REAL, GpCustomLineCap**); GpStatus WINGDIPAPI GdipDeleteCustomLineCap(GpCustomLineCap*); +GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT,INT,INT,PixelFormat,BYTE*, + GpBitmap**); GpStatus WINGDIPAPI GdipDisposeImage(GpImage*); GpStatus WINGDIPAPI GdipGetImageBounds(GpImage*,GpRectF*,GpUnit*); GpStatus WINGDIPAPI GdipGetImageHeight(GpImage*,UINT*); diff --git a/include/gdiplusgpstubs.h b/include/gdiplusgpstubs.h index 30a04d2..fec691a 100644 --- a/include/gdiplusgpstubs.h +++ b/include/gdiplusgpstubs.h @@ -32,6 +32,7 @@ class GpCustomLineCap {}; class GpImage {}; class GpMetafile : public GpImage {}; class GpImageAttributes {}; +class GpBitmap : public GpImage {}; #else /* end of c++ declarations */ @@ -46,6 +47,7 @@ typedef struct GpCustomLineCap GpCustomLineCap; typedef struct GpImage GpImage; typedef struct GpMetafile GpMetafile; typedef struct GpImageAttributes GpImageAttributes; +typedef struct GpBitmap GpBitmap; #endif /* end of c declarations */ diff --git a/include/gdipluspixelformats.h b/include/gdipluspixelformats.h index b2110c1..6f50492 100644 --- a/include/gdipluspixelformats.h +++ b/include/gdipluspixelformats.h @@ -20,5 +20,6 @@ #define _GDIPLUSPIXELFORMATS_H typedef DWORD ARGB; +typedef INT PixelFormat; #endif
1
0
0
0
Evan Stade : gdiplus: Implemented GdipLoadImageFromStreamICM.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 4c5486fe923e138f34f258fff4f8c97c2bae90c5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4c5486fe923e138f34f258fff…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:48 2007 -0700 gdiplus: Implemented GdipLoadImageFromStreamICM. --- dlls/gdiplus/brush.c | 3 +++ dlls/gdiplus/customlinecap.c | 2 ++ dlls/gdiplus/gdiplus.c | 2 ++ dlls/gdiplus/graphicspath.c | 3 +++ dlls/gdiplus/image.c | 21 ++++++++++++++++----- dlls/gdiplus/imageattributes.c | 2 ++ dlls/gdiplus/matrix.c | 2 ++ dlls/gdiplus/pathiterator.c | 2 ++ dlls/gdiplus/pen.c | 3 +++ include/gdiplusflat.h | 1 + 10 files changed, 36 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 76456bd..ce01ccb 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -18,6 +18,9 @@ #include "windef.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index eb851c9..417a740 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -22,6 +22,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 041d6fe..edbfb1c 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -25,6 +25,8 @@ #include "wine/debug.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/graphicspath.c b/dlls/gdiplus/graphicspath.c index 4fe99e0..ea52408 100644 --- a/dlls/gdiplus/graphicspath.c +++ b/dlls/gdiplus/graphicspath.c @@ -24,6 +24,9 @@ #include "winbase.h" #include "winuser.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index ba5a23e..00d0a58 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -20,10 +20,12 @@ #include "windef.h" #include "winbase.h" +#include "winuser.h" #include "wingdi.h" #define COBJMACROS #include "objbase.h" +#include "olectl.h" #include "gdiplus.h" #include "gdiplus_private.h" @@ -172,15 +174,24 @@ GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, return NotImplemented; } +/* FIXME: no ICM */ GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream* stream, GpImage **image) { - static int calls; - if(!stream || !image) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + *image = GdipAlloc(sizeof(GpImage)); + if(!*image) return OutOfMemory; - return NotImplemented; + if(OleLoadPicture(stream, 0, FALSE, &IID_IPicture, + (LPVOID*) &((*image)->picture)) != S_OK){ + TRACE("Could not load picture\n"); + GdipFree(*image); + return GenericError; + } + + /* FIXME: use IPicture_get_Type to get image type */ + (*image)->type = ImageTypeUnknown; + + return Ok; } diff --git a/dlls/gdiplus/imageattributes.c b/dlls/gdiplus/imageattributes.c index 7c36780..29b8549 100644 --- a/dlls/gdiplus/imageattributes.c +++ b/dlls/gdiplus/imageattributes.c @@ -19,6 +19,8 @@ #include "windef.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 1c4738e..e6be418 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -23,6 +23,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/pathiterator.c b/dlls/gdiplus/pathiterator.c index b978c26..d1e4e88 100644 --- a/dlls/gdiplus/pathiterator.c +++ b/dlls/gdiplus/pathiterator.c @@ -22,6 +22,8 @@ #include "winbase.h" #include "wingdi.h" +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/pen.c b/dlls/gdiplus/pen.c index b85f158..f121380 100644 --- a/dlls/gdiplus/pen.c +++ b/dlls/gdiplus/pen.c @@ -21,6 +21,9 @@ #include "windef.h" #include "winbase.h" #include "wingdi.h" + +#include "objbase.h" + #include "gdiplus.h" #include "gdiplus_private.h" #include "wine/debug.h" diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 4906160..348d7c0 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -148,6 +148,7 @@ GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); +GpStatus WINGDIPAPI GdipLoadImageFromStreamICM(IStream*,GpImage**); GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**); GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes*);
1
0
0
0
Evan Stade : gdiplus: Added GdipCreateMatrix3.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 7b601148d5ca0e6185fb0602d3f517ce1872e756 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7b601148d5ca0e6185fb0602d…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:44 2007 -0700 gdiplus: Added GdipCreateMatrix3. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 17 +++++++++++++++++ include/gdiplusflat.h | 2 ++ 3 files changed, 20 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 37d7dff..0b57027 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -105,7 +105,7 @@ @ stub GdipCreateLineBrushFromRectWithAngleI @ stub GdipCreateLineBrushI @ stdcall GdipCreateMatrix2(long long long long long long ptr) -@ stub GdipCreateMatrix3 +@ stdcall GdipCreateMatrix3(ptr ptr ptr) @ stub GdipCreateMatrix3I @ stdcall GdipCreateMatrix(ptr) @ stdcall GdipCreateMetafileFromEmf(ptr long ptr) diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 3f96e4f..1c4738e 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -70,6 +70,23 @@ GpStatus WINGDIPAPI GdipCreateMatrix2(REAL m11, REAL m12, REAL m21, REAL m22, return Ok; } +GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *rect, + GDIPCONST GpPointF *pt, GpMatrix **matrix) +{ + if(!matrix) + return InvalidParameter; + + *matrix = GdipAlloc(sizeof(GpMatrix)); + if(!*matrix) return OutOfMemory; + + memcpy((*matrix)->matrix, rect, 4 * sizeof(REAL)); + + (*matrix)->matrix[4] = pt->X; + (*matrix)->matrix[5] = pt->Y; + + return Ok; +} + GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix *matrix, GpMatrix **clone) { if(!matrix || !clone) diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 2140550..4906160 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -114,6 +114,8 @@ GpStatus WINGDIPAPI GdipTransformPath(GpPath*,GpMatrix*); GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix*,GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**); +GpStatus WINGDIPAPI GdipCreateMatrix3(GDIPCONST GpRectF *,GDIPCONST GpPointF*, + GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix**); GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*); GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix*,REAL*);
1
0
0
0
Evan Stade : gdiplus: Added GdipSetMatrixElements.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: ad251e7fe33a3eec2549c69661eb2932f3e1fcfa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ad251e7fe33a3eec2549c6966…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:41 2007 -0700 gdiplus: Added GdipSetMatrixElements. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 16 ++++++++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 18 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 95a3618..37d7dff 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -543,7 +543,7 @@ @ stub GdipSetLineSigmaBlend @ stub GdipSetLineTransform @ stub GdipSetLineWrapMode -@ stub GdipSetMatrixElements +@ stdcall GdipSetMatrixElements(ptr long long long long long long) @ stub GdipSetMetafileDownLevelRasterizationLimit @ stdcall GdipSetPageScale(ptr long) @ stdcall GdipSetPageUnit(ptr long) diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index afb2efe..3f96e4f 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -186,6 +186,22 @@ GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix *matrix, REAL scaleX, REAL scaleY, return Ok; } +GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix *matrix, REAL m11, REAL m12, + REAL m21, REAL m22, REAL dx, REAL dy) +{ + if(!matrix) + return InvalidParameter; + + matrix->matrix[0] = m11; + matrix->matrix[1] = m12; + matrix->matrix[2] = m21; + matrix->matrix[3] = m22; + matrix->matrix[4] = dx; + matrix->matrix[5] = dy; + + return Ok; +} + GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix *matrix, GpPointF *pts, INT count) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index b618dad..2140550 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -120,6 +120,7 @@ GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix*,REAL*); GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GpMatrix*,GpMatrixOrder); GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder); +GpStatus WINGDIPAPI GdipSetMatrixElements(GpMatrix*,REAL,REAL,REAL,REAL,REAL,REAL); GpStatus WINGDIPAPI GdipTransformMatrixPoints(GpMatrix*,GpPointF*,INT); GpStatus WINGDIPAPI GdipTranslateMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);
1
0
0
0
Evan Stade : gdiplus: Added GdipGetMatrixElements.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: dd5e9a91f364d02869b00a355227373242d813e0 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dd5e9a91f364d02869b00a355…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:37 2007 -0700 gdiplus: Added GdipGetMatrixElements. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/matrix.c | 11 +++++++++++ include/gdiplusflat.h | 1 + 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 8dd2e2a..95a3618 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -313,7 +313,7 @@ @ stub GdipGetLineWrapMode @ stub GdipGetLogFontA @ stub GdipGetLogFontW -@ stub GdipGetMatrixElements +@ stdcall GdipGetMatrixElements(ptr ptr) @ stub GdipGetMetafileDownLevelRasterizationLimit @ stub GdipGetMetafileHeaderFromEmf @ stub GdipGetMetafileHeaderFromFile diff --git a/dlls/gdiplus/matrix.c b/dlls/gdiplus/matrix.c index 50d511a..afb2efe 100644 --- a/dlls/gdiplus/matrix.c +++ b/dlls/gdiplus/matrix.c @@ -111,6 +111,17 @@ GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix *matrix) return Ok; } +GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix *matrix, + REAL *out) +{ + if(!matrix || !out) + return InvalidParameter; + + memcpy(out, matrix->matrix, sizeof(matrix->matrix)); + + return Ok; +} + GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix *matrix, GpMatrix* matrix2, GpMatrixOrder order) { diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index 31b17f5..b618dad 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -116,6 +116,7 @@ GpStatus WINGDIPAPI GdipCloneMatrix(GpMatrix*,GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix2(REAL,REAL,REAL,REAL,REAL,REAL,GpMatrix**); GpStatus WINGDIPAPI GdipCreateMatrix(GpMatrix**); GpStatus WINGDIPAPI GdipDeleteMatrix(GpMatrix*); +GpStatus WINGDIPAPI GdipGetMatrixElements(GDIPCONST GpMatrix*,REAL*); GpStatus WINGDIPAPI GdipMultiplyMatrix(GpMatrix*,GpMatrix*,GpMatrixOrder); GpStatus WINGDIPAPI GdipRotateMatrix(GpMatrix*,REAL,GpMatrixOrder); GpStatus WINGDIPAPI GdipScaleMatrix(GpMatrix*,REAL,REAL,GpMatrixOrder);
1
0
0
0
Evan Stade : gdiplus: Added GdipFindFirstImageItem stub.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: 7a8866b347f0604d40ec7579921ac197f695120f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7a8866b347f0604d40ec75799…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:33 2007 -0700 gdiplus: Added GdipFindFirstImageItem stub. --- dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index dc7633c..8dd2e2a 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -231,7 +231,7 @@ @ stub GdipFillRectangles @ stub GdipFillRectanglesI @ stub GdipFillRegion -@ stub GdipFindFirstImageItem +@ stdcall GdipFindFirstImageItem(ptr ptr) @ stub GdipFindNextImageItem @ stub GdipFlattenPath @ stub GdipFlush diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index 46b3357..ba5a23e 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -31,6 +31,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(gdiplus); +typedef void ImageItemData; + GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) { if(!image) @@ -42,6 +44,14 @@ GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image) return Ok; } +GpStatus WINGDIPAPI GdipFindFirstImageItem(GpImage *image, ImageItemData* item) +{ + if(!image || !item) + return InvalidParameter; + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipGetImageBounds(GpImage *image, GpRectF *srcRect, GpUnit *srcUnit) {
1
0
0
0
Evan Stade : gdiplus: Added GdipGetMetafileHeaderFromMetafile stub.
by Alexandre Julliard
01 Aug '07
01 Aug '07
Module: wine Branch: master Commit: e91d12454a6e709e9e5ded4369ae69f9c3db7455 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e91d12454a6e709e9e5ded436…
Author: Evan Stade <estade(a)gmail.com> Date: Tue Jul 31 19:15:29 2007 -0700 gdiplus: Added GdipGetMetafileHeaderFromMetafile stub. --- dlls/gdiplus/customlinecap.c | 1 + dlls/gdiplus/gdiplus.c | 2 + dlls/gdiplus/gdiplus.spec | 2 +- dlls/gdiplus/image.c | 14 +++++ dlls/gdiplus/imageattributes.c | 1 + dlls/gdiplus/pathiterator.c | 1 + include/gdiplusenums.h | 11 ++++ include/gdiplusflat.h | 1 + include/gdiplusmetaheader.h | 123 ++++++++++++++++++++++++++++++++++++++++ 9 files changed, 155 insertions(+), 1 deletions(-) diff --git a/dlls/gdiplus/customlinecap.c b/dlls/gdiplus/customlinecap.c index aadea5f..eb851c9 100644 --- a/dlls/gdiplus/customlinecap.c +++ b/dlls/gdiplus/customlinecap.c @@ -20,6 +20,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/gdiplus.c b/dlls/gdiplus/gdiplus.c index 80a4b9c..041d6fe 100644 --- a/dlls/gdiplus/gdiplus.c +++ b/dlls/gdiplus/gdiplus.c @@ -23,6 +23,8 @@ #include "winbase.h" #include "winerror.h" #include "wine/debug.h" +#include "wingdi.h" + #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index 8502e4c..dc7633c 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -317,7 +317,7 @@ @ stub GdipGetMetafileDownLevelRasterizationLimit @ stub GdipGetMetafileHeaderFromEmf @ stub GdipGetMetafileHeaderFromFile -@ stub GdipGetMetafileHeaderFromMetafile +@ stdcall GdipGetMetafileHeaderFromMetafile(ptr ptr) @ stub GdipGetMetafileHeaderFromStream @ stub GdipGetMetafileHeaderFromWmf @ stub GdipGetNearestColor diff --git a/dlls/gdiplus/image.c b/dlls/gdiplus/image.c index c378981..46b3357 100644 --- a/dlls/gdiplus/image.c +++ b/dlls/gdiplus/image.c @@ -134,6 +134,20 @@ GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width) return NotImplemented; } +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile * metafile, + MetafileHeader * header) +{ + static int calls; + + if(!metafile || !header) + return InvalidParameter; + + if(!(calls++)) + FIXME("not implemented\n"); + + return NotImplemented; +} + GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage *image, GDIPCONST GUID* dimensionID, UINT* count) { diff --git a/dlls/gdiplus/imageattributes.c b/dlls/gdiplus/imageattributes.c index b378143..7c36780 100644 --- a/dlls/gdiplus/imageattributes.c +++ b/dlls/gdiplus/imageattributes.c @@ -17,6 +17,7 @@ */ #include "windef.h" +#include "wingdi.h" #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/dlls/gdiplus/pathiterator.c b/dlls/gdiplus/pathiterator.c index a9e1d3f..b978c26 100644 --- a/dlls/gdiplus/pathiterator.c +++ b/dlls/gdiplus/pathiterator.c @@ -20,6 +20,7 @@ #include "windef.h" #include "winbase.h" +#include "wingdi.h" #include "gdiplus.h" #include "gdiplus_private.h" diff --git a/include/gdiplusenums.h b/include/gdiplusenums.h index 2d3c229..9d81051 100644 --- a/include/gdiplusenums.h +++ b/include/gdiplusenums.h @@ -173,6 +173,16 @@ enum WrapMode WrapModeClamp }; +enum MetafileType +{ + MetafileTypeInvalid, + MetafileTypeWmf, + MetafileTypeWmfPlaceable, + MetafileTypeEmf, + MetafileTypeEmfPlusOnly, + MetafileTypeEmfPlusDual +}; + #ifndef __cplusplus typedef enum Unit Unit; @@ -191,6 +201,7 @@ typedef enum DashStyle DashStyle; typedef enum MatrixOrder MatrixOrder; typedef enum ImageType ImageType; typedef enum WrapMode WrapMode; +typedef enum MetafileType MetafileType; #endif /* end of c typedefs */ diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index e4c5ba0..31b17f5 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -142,6 +142,7 @@ GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage*,GUID*); GpStatus WINGDIPAPI GdipGetImageType(GpImage*,ImageType*); GpStatus WINGDIPAPI GdipGetImageVerticalResolution(GpImage*,REAL*); GpStatus WINGDIPAPI GdipGetImageWidth(GpImage*,UINT*); +GpStatus WINGDIPAPI GdipGetMetafileHeaderFromMetafile(GpMetafile*,MetafileHeader*); GpStatus WINGDIPAPI GdipImageGetFrameCount(GpImage*,GDIPCONST GUID*,UINT*); GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes**); diff --git a/include/gdiplusmetaheader.h b/include/gdiplusmetaheader.h index 2b4adf6..e59ab09 100644 --- a/include/gdiplusmetaheader.h +++ b/include/gdiplusmetaheader.h @@ -19,6 +19,25 @@ #ifndef _GDIPLUSMETAHEADER_H #define _GDIPLUSMETAHEADER_H +typedef struct +{ + DWORD iType; + DWORD nSize; + RECTL rclBounds; + RECTL rclFrame; + DWORD dSignature; + DWORD nVersion; + DWORD nBytes; + DWORD nRecords; + WORD nHandles; + WORD sReserved; + DWORD nDescription; + DWORD offDescription; + DWORD nPalEntries; + SIZEL szlDevice; + SIZEL szlMillimeters; +} ENHMETAHEADER3; + #include <pshpack2.h> typedef struct @@ -41,4 +60,108 @@ typedef struct #include <poppack.h> +#define GDIP_EMFPLUSFLAGS_DISPLAY 0x00000001 + +#ifdef __cplusplus +class MetafileHeader +{ +public: + MetafileType Type; + UINT Size; + UINT Version; + UINT EmfPlusFlags; + REAL DpiX; + REAL DpiY; + INT X; + INT Y; + INT Width; + INT Height; + union + { + METAHEADER WmfHeader; + ENHMETAHEADER3 EmfHeader; + }; + INT EmfPlusHeaderSize; + INT LogicalDpiX; + INT LogicalDpiY; + +public: + MetafileType GetType() const { return Type; } + + UINT GetMetafileSize() const { return Size; } + + UINT GetVersion() const { return Version; } + + UINT GetEmfPlusFlags() const { return EmfPlusFlags; } + + REAL GetDpiX() const { return DpiX; } + + REAL GetDpiY() const { return DpiY; } + + VOID GetBounds (OUT Rect *r) const + { + r->X = X; + r->Y = Y; + r->Width = Width; + r->Height = Height; + } + + BOOL IsWmf() const + { + return ((Type == MetafileTypeWmf) || (Type == MetafileTypeWmfPlaceable)); + } + + BOOL IsWmfPlaceable() const { return (Type == MetafileTypeWmfPlaceable); } + + BOOL IsEmf() const { return (Type == MetafileTypeEmf); } + + BOOL IsEmfOrEmfPlus() const { return (Type >= MetafileTypeEmf); } + + BOOL IsEmfPlus() const { return (Type >= MetafileTypeEmfPlusOnly); } + + BOOL IsEmfPlusDual() const { return (Type == MetafileTypeEmfPlusDual); } + + BOOL IsEmfPlusOnly() const { return (Type == MetafileTypeEmfPlusOnly); } + + BOOL IsDisplay() const + { + return IsEmfPlus() && ((EmfPlusFlags & GDIP_EMFPLUSFLAGS_DISPLAY) != 0); + } + + const METAHEADER * GetWmfHeader() const + { + return IsWmf() ? &WmfHeader : NULL; + } + + const ENHMETAHEADER3 * GetEmfHeader() const + { + return IsEmfOrEmfPlus() ? &EmfHeader : NULL; + } +}; +#else /* end of c++ typedefs */ + +typedef struct MetafileHeader +{ + MetafileType Type; + UINT Size; + UINT Version; + UINT EmfPlusFlags; + REAL DpiX; + REAL DpiY; + INT X; + INT Y; + INT Width; + INT Height; + union + { + METAHEADER WmfHeader; + ENHMETAHEADER3 EmfHeader; + } DUMMYUNIONNAME; + INT EmfPlusHeaderSize; + INT LogicalDpiX; + INT LogicalDpiY; +} MetafileHeader; + +#endif /* end of c typedefs */ + #endif /* _GDIPLUSMETAHEADER_H */
1
0
0
0
← Newer
1
...
102
103
104
105
106
107
108
109
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Results per page:
10
25
50
100
200