Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3a7e54f5
Kaydet (Commit)
3a7e54f5
authored
Eyl 21, 2014
tarafından
Tomaž Vajngerl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convenient function to compress a Graphic to PNG image
Change-Id: I3d30dd4337b6bd3b5b0c7cdf97a8787c4bc37fa3
üst
6b894d17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
graphicfilter.hxx
include/vcl/graphicfilter.hxx
+2
-0
graphicfilter.cxx
vcl/source/filter/graphicfilter.cxx
+12
-0
No files found.
include/vcl/graphicfilter.hxx
Dosyayı görüntüle @
3a7e54f5
...
@@ -320,6 +320,8 @@ public:
...
@@ -320,6 +320,8 @@ public:
Graphic
&
rGraphic
,
Graphic
&
rGraphic
,
GraphicFilter
*
pFilter
=
NULL
,
GraphicFilter
*
pFilter
=
NULL
,
sal_uInt16
*
pDeterminedFormat
=
NULL
);
sal_uInt16
*
pDeterminedFormat
=
NULL
);
sal_uInt16
compressAsPNG
(
const
Graphic
&
rGraphic
,
SvStream
&
rOutputStream
,
sal_uInt32
nCompression
=
5
);
};
};
#endif // INCLUDED_VCL_GRAPHICFILTER_HXX
#endif // INCLUDED_VCL_GRAPHICFILTER_HXX
...
...
vcl/source/filter/graphicfilter.cxx
Dosyayı görüntüle @
3a7e54f5
...
@@ -2302,4 +2302,16 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa
...
@@ -2302,4 +2302,16 @@ int GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilterNa
return
nRes
;
return
nRes
;
}
}
sal_uInt16
GraphicFilter
::
compressAsPNG
(
const
Graphic
&
rGraphic
,
SvStream
&
rOutputStream
,
sal_uInt32
nCompression
)
{
nCompression
=
MinMax
(
nCompression
,
0
,
100
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aFilterData
(
1
);
aFilterData
[
0
].
Name
=
"Compression"
;
aFilterData
[
0
].
Value
<<=
nCompression
;
sal_uInt16
nFilterFormat
=
GetExportFormatNumberForShortName
(
"PNG"
);
return
ExportGraphic
(
rGraphic
,
OUString
(),
rOutputStream
,
nFilterFormat
,
&
aFilterData
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment