Date: prev next · Thread: first prev next last
2015 Archives by date, by thread · List index


When querying a XGraphic from a URL, the size of the Graphic is always the original size coming from the URL, the FilterData seems to been ignored. The result from my function "getGraphFromUrl" returns always the orginal graphic size and not the demanded 500x1000 pixels
When Storing to a URL the Graphic takes the size asked by the Filterdata
the result of my sub "storeGraphicToURL" gives a graphic 500x1000 pixels
Can someone confirm this behaviour or I am doing something wrong.
of course the work around is simple, query first, store to a temp location and query again ....
Thanks for any hint

Fernand

function getGraphFromUrl(sFileUrl as String) as Object
  oProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
'creating filter data
    Dim aFilterData (1) as new com.sun.star.beans.PropertyValue
'properties valid for all filters
aFilterData(0).Name  = "PixelWidth"        '
aFilterData(0).Value = 500 'pixels
aFilterData(1).Name  = "PixelHeight"
aFilterData(1).Value = 1000
  Dim oPropsIN(1)as new com.sun.star.beans.PropertyValue
  oPropsIN(0).Name  = "URL"
  oPropsIN(0).Value = sFileUrl
  oPropsIN(1).Name  = "FilterData"
    oPropsIN(1).Value = aFilterData()
  getGraphFromUrl = oProvider.queryGraphic(oPropsIN())
end function




sub storeGraphicToURL(xgraphic,exportURL)
gProvider = createUnoService("com.sun.star.graphic.GraphicProvider")
Dim bArgs(2) as new com.sun.star.beans.PropertyValue
'creating filter data
    Dim aFilterData (1) as new com.sun.star.beans.PropertyValue
'properties valid for all filters
aFilterData(0).Name  = "PixelWidth"        '
aFilterData(0).Value = 500
aFilterData(1).Name  = "PixelHeight"
aFilterData(1).Value = 1000

      bArgs(0).Name = "URL"
      bArgs(0).Value = exportURL
      bArgs(1).Name = "MimeType"
      bArgs(1).Value = "image/jpeg" 'geen "jpg" wel "jpeg"
      bArgs(2).Name = "FilterData"
      bArgs(2).Value = aFilterdata
      gProvider.storeGraphic(xgraphic,bArgs())
end sub


--
To unsubscribe e-mail to: users+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.