diff options
| author | Alvin Penner <penner@vaxxine.com> | 2011-03-31 00:37:39 +0000 |
|---|---|---|
| committer | Alvin Penner <penner@vaxxine.com> | 2011-03-31 00:37:39 +0000 |
| commit | be2a3a1b134772cbff37f3906ab3d1b8673000ec (patch) | |
| tree | 05e570a8c4cc34961edd14feb62083e0e7fedfb0 /src | |
| parent | Extensions: (diff) | |
| download | inkscape-be2a3a1b134772cbff37f3906ab3d1b8673000ec.tar.gz inkscape-be2a3a1b134772cbff37f3906ab3d1b8673000ec.zip | |
emf import. limited support for EMR_BITBLT (Bug 382421)
Fixed bugs:
- https://launchpad.net/bugs/382421
(bzr r10136)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/internal/emf-win32-inout.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index 607827943..cea68c6da 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -75,6 +75,7 @@ #define PS_JOIN_MASK (PS_JOIN_BEVEL|PS_JOIN_MITER|PS_JOIN_ROUND) #endif +#define DPA 0x00A000C9 // TernaryRasterOperation namespace Inkscape { namespace Extension { @@ -1761,8 +1762,36 @@ myEnhMetaFileProc(HDC /*hDC*/, HANDLETABLE * /*lpHTable*/, ENHMETARECORD const * dbg_str << "<!-- EMR_EXTSELECTCLIPRGN -->\n"; break; case EMR_BITBLT: + { dbg_str << "<!-- EMR_BITBLT -->\n"; + + PEMRBITBLT pEmr = (PEMRBITBLT) lpEMFR; + if (pEmr->dwRop == DPA) { + // should be an application of a DIBPATTERNBRUSHPT, use a solid color instead + double l = pix_to_x_point( d, pEmr->xDest, pEmr->yDest); + double t = pix_to_y_point( d, pEmr->xDest, pEmr->yDest); + double r = pix_to_x_point( d, pEmr->xDest + pEmr->cxDest, pEmr->yDest + pEmr->cyDest); + double b = pix_to_y_point( d, pEmr->xDest + pEmr->cxDest, pEmr->yDest + pEmr->cyDest); + + SVGOStringStream tmp_rectangle; + tmp_rectangle << "d=\""; + tmp_rectangle << "\n\tM " << l << " " << t << " "; + tmp_rectangle << "\n\tL " << r << " " << t << " "; + tmp_rectangle << "\n\tL " << r << " " << b << " "; + tmp_rectangle << "\n\tL " << l << " " << b << " "; + tmp_rectangle << "\n\tz"; + + assert_empty_path(d, "EMR_BITBLT"); + + *(d->outsvg) += " <path "; + output_style(d, lpEMFR->iType); + *(d->outsvg) += "\n\t"; + *(d->outsvg) += tmp_rectangle.str().c_str(); + *(d->outsvg) += " \" /> \n"; + *(d->path) = ""; + } break; + } case EMR_STRETCHBLT: dbg_str << "<!-- EMR_STRETCHBLT -->\n"; break; |
