StreamSupplier::StreamSupplier(uno::Reference<io::XInputStream> xInput, uno::Reference<io::XOutputStream> xOutput)
: m_xInput(std::move(xInput))
, m_xOutput(std::move(xOutput))
{
m_xSeekable.set(m_xInput, uno::UNO_QUERY); if (!m_xSeekable.is())
m_xSeekable.set(m_xOutput, uno::UNO_QUERY);
OSL_ENSURE(m_xSeekable.is(), "StreamSupplier::StreamSupplier: at least one of both must be seekable!");
}
try
{ // get a GraphicProvider
uno::Reference<graphic::XGraphicProvider> xProvider = css::graphic::GraphicProvider::create(rxContext);
// let it create a graphic from the given URL
uno::Sequence<beans::PropertyValue> aMediaProperties{ comphelper::makePropertyValue(
u"URL"_ustr, rImageResourceURL) };
uno::Reference<graphic::XGraphic> xGraphic(xProvider->queryGraphic(aMediaProperties));
OSL_ENSURE(xGraphic.is(), "GraphicAccess::getImageStream: the provider did not give us a graphic object!"); if (!xGraphic.is()) return pMemBuffer;
// copy the graphic to an in-memory buffer
pMemBuffer.reset(new SvMemoryStream);
uno::Reference<io::XStream> xBufferAccess = new StreamSupplier( new OSeekableInputStreamWrapper(*pMemBuffer), new OSeekableOutputStreamWrapper(*pMemBuffer));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.