wordpress hit counter
Welcome to OpenXML Developer Sign in | Join | Help

Get Pixels/EMUs Informations

Last post 02-21-2008, 12:45 PM by BernardoP. 6 replies.
Sort Posts: Previous Next
  •  02-18-2008, 12:48 PM 2755

    Get Pixels/EMUs Informations

    Hello!

    I have in PPTX Presentation this code:

      <a:blip r:embed="rId2" cstate="print" />
      <a:srcRect l="15555" t="30556" r="15556" />
    - <a:stretch>
      <a:fillRect />
      </a:stretch>
      </p:blipFill>
    - <p:spPr bwMode="auto">
    - <a:xfrm>
      <a:off x="4038600" y="2209800" />
      <a:ext cx="2362200" cy="1905000" />
      </a:xfrm>
     
    CX = 2362200 / 9525 = 248 pixels
    CY = 1905000 / 9525 = 200 pixels
     
    srcRect have three attributes:  left, top and right.
     
    When I transform EMU to PIXELS:
     
    L = 15555 / 9525 = 1.63 pixels
    T = 30556 / 9525 = 3.20 pixels
    R =  15556 / 9525 = 1.63 pixels
     
    This values aren't correct because image is cropped wrong.
     
    What I can do?
     
  •  02-19-2008, 12:15 AM 2758 in reply to 2755

    Re: Get Pixels/EMUs Informations

    Hi,

    For cropping the image, original height, width and the resolution of the image (from image property summary tab) has to be taken. Then apply the l,t,r attribute values of <a:srcRect> element to the original value to get the cropped image.

    Sheela

  •  02-19-2008, 12:14 PM 2762 in reply to 2758

    Re: Get Pixels/EMUs Informations

    Where can I find the resolution of the image? I didn't found the image property summary.
     
    If I have the coordenates cx, xy, l,t,r above and one image with 825x600. What the cropped area?
     
    Thanks !
     
  •  02-20-2008, 1:28 AM 2767 in reply to 2762

    Re: Get Pixels/EMUs Informations

    Hi,


    For  image width and height , we have to look on cx and cy value in slide.xml.there cx and cy in emu
    that we have to convert in inch.
     
    This is the formula
     
    cx/(360000*2.54)
     
    cy/(360000*2.54)
     
     
    this is applicable in both the cases before and after cropping

     


    Sheela

  •  02-20-2008, 12:09 PM 2771 in reply to 2767

    Re: Get Pixels/EMUs Informations

    Sheela,

    No problem when I calculate the coordenates (cx and cy).

    Using the formula:

    Image CX: (2362200 / (360000 * 2.54)) * 96;
    CX = 248 px;

    Image CY: (1905000 / (360000 * 2.54)) * 96;
    CY = 200 px;

    PERFECT RESULTS!

    ____________________________________________

    I have difficult to work with <srcrect> T, L, R, B.

    When I calculate the cropped area ... I get low values using the formula:

    Top Crop:
    T = (30556 / (360000 * 2.54)) * 96;
    T = 3.2 pixels

    Left Crop:
    L = (15555 / (360000 * 2.54)) * 96;
    L = 1.6 pixels

    Right Crop:
    R = (15556 / (360000 * 2.54)) * 96;
    R = 1.6 pixels

    What is the problem? This values aren't correct!

  •  02-21-2008, 4:49 AM 2775 in reply to 2771

    Re: Get Pixels/EMUs Informations

    Hi, 

        cx and cy values are in EMU but l ,t ,r , b are represen ted in percentage in1000th of percent  (not in EMU). 
     
        1. first we have to divide these values by 1000
     
         2. t hen for l and r  we have to calulate how much percent these value of cx value before cropping
     
            by   Bcx*l,r/100       Bcx = value of cx before cropping
     
           then for t and b we have to calulate how much percent these value of cy value before cropping
     
           by   Bcy*t,b/100       Bcy = value of cy before cropping
     
     
          the value of l,r,t,b you will get after 2nd step that will be in emu now
     
         then again we have to convert it to inch
     
          by   l,r,t,b/(360000*2.54) 
     
     
    Mallika 
  •  02-21-2008, 12:45 PM 2777 in reply to 2775

    Re: Get Pixels/EMUs Informations

    Mallika and Sheela,

    Thanks!

View as RSS news feed in XML