none
WMF - flipping , rotation RRS feed

Answers

  •  Hi,

        Just to recap what we found after analyzing the test file received.   We found that the WMF to be replayed is embedded in a word file.   We extracted the WMF file from the word file and replayed it in other Windows GDI application such as paint and we didn't see any problem.   We think that the fliping of the image is not related to any record in WMF file, instead , it is related to the format of the hosting word file.   This became a question of word file format instead of WMF file format.

       I also got confirmation from Farwaha that the issue has been resolved.

    Thanks!

     

     


    Hongwei Sun -MSFT
    Monday, May 9, 2011 7:19 PM

All replies

  • Hi, Farwaha,

       Thanks for your question.  We will look at it and respond to you soon.

     

     

     


    Hongwei Sun -MSFT
    Friday, April 29, 2011 10:49 PM
  • Farwaha,

    There are several ways that the image could be flipped / rotated (e.g. coordinate transformations can occur at more than one level).

    Can you try asking a more specific question? Or provide some explanation as to what you are trying to do?

    Brad

    Saturday, April 30, 2011 11:33 PM
  • Karuna,

    I think this is an unreasonable request, since the transformations are all documented in MS-WMF specification - you can read them there better than I can explain them here.

    Does the flipping occur for every image, or just some problem images?

    Have you checked that you are implementing every record type that is used in the documents?

    Have you checked that you are implementing the MapMode and related records correctly (see MS-WMF 2.1.1.6), since that changes the direction of increasing Y (i.e. coordinate origin could be top left or bottom left according to MapMode)?

    Brad

    Monday, May 2, 2011 9:34 PM
  •  Brad,

    This flipping issue I am facing is only with some EMF or WMF images. The images are mostly bunch of polygons(i.e. recordType Meta_POLYGON 0x324 or 0x325)

    EMF Image  -  mapmode of 8 (anisotropic)

    WMF image - mapMode record is missing so I am using default i.e. MM_TEXT 

    In both of the above mentioned mapModes positive X is to right and positive right is down. I have some images working fine with above mentioned scenario.

     WMF - I understand that flipping can be applied at global level and local level. The only way  to recognize the global level flipping I have found in documentation is by looking at the sign of window extents (Record : META_SETWINDOWEXT ).On the other hand at local level BITMAP records specify any kind of flipping that can be applied.However I am not sure of any way in which I can find out the rotation applied to the image

     EMF -  Any kind of coordinate transformation information is in XForm structure which can be present at global or local level usually in setWorldTransform/ModifYWorldTransform Records.

    The issue is that, in WMF file my window extents are positive and in EMF file the records to set XForm are missing.So I am wondering what other information I can use?

     

     

    Thanks

    Farwaha

    Tuesday, May 3, 2011 2:28 PM
  • Hi Farwaha,

    You didn't answer my question "Have you checked that you are implementing every record type that is used in the documents?"

    Basically, if you are trying to do an incomplete implementation, you can't expect the results to come out right.

    Brad

     

    Wednesday, May 4, 2011 12:15 AM
  • Hi, Farwaha,

       I am working on your questions about the flip and rotation in WMF file.    I assume that you have encounted flipped images when replaying some WMF/EMF files, comparing with a  reference implementation(Windows ?).   If so, could you share some of these files ?  You can send the files to dochelp@microsoft.com with the reference to me.  Are these files created by Windows ?     When you see the fliping,  is it flipped  horizontally or vertically ?

       WMF files don't support rotation of objects in general although text can be rotated in WMF files.

    Thanks!

     

     

     


    Hongwei Sun -MSFT
    Wednesday, May 4, 2011 6:56 PM
  • Thanks. I have sent the test file at the requested address.

     

    Thanks

    Farwaha

    Thursday, May 5, 2011 9:43 PM
  •  Hi,

        Just to recap what we found after analyzing the test file received.   We found that the WMF to be replayed is embedded in a word file.   We extracted the WMF file from the word file and replayed it in other Windows GDI application such as paint and we didn't see any problem.   We think that the fliping of the image is not related to any record in WMF file, instead , it is related to the format of the hosting word file.   This became a question of word file format instead of WMF file format.

       I also got confirmation from Farwaha that the issue has been resolved.

    Thanks!

     

     


    Hongwei Sun -MSFT
    Monday, May 9, 2011 7:19 PM