INTEGRATION: CWS bmpres01 (1.49.18); FILE MERGED

2004/04/27 14:32:30 ka 1.49.18.1: using new resource structure for images
This commit is contained in:
Kurt Zenker 2004-05-18 23:46:12 +00:00
parent 0d646d83e5
commit 2e1116f409

View file

@ -2,9 +2,9 @@
* *
* $RCSfile: sdview3.cxx,v $ * $RCSfile: sdview3.cxx,v $
* *
* $Revision: 1.49 $ * $Revision: 1.50 $
* *
* last change: $Author: obo $ $Date: 2004-01-20 12:54:05 $ * last change: $Author: kz $ $Date: 2004-05-19 00:46:12 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
@ -177,6 +177,9 @@
#include "strmname.h" #include "strmname.h"
#include "unomodel.hxx" #include "unomodel.hxx"
#include <tools/stream.hxx>
#include <vcl/cvtgrf.hxx>
// -------------- // --------------
// - Namespaces - // - Namespaces -
// -------------- // --------------
@ -1032,6 +1035,33 @@ BOOL View::InsertData( const TransferableDataHelper& rDataHelper,
if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) ) if( aDataHelper.GetGDIMetaFile( FORMAT_GDIMETAFILE, aMtf ) )
{ {
SvFileStream aSvOutputStream( String( RTL_CONSTASCII_USTRINGPARAM( "/tmp/test.png" ) ), STREAM_WRITE | STREAM_TRUNC );
Graphic aMtfGraphic( aMtf );
Size aPreviewSizePixel( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MAP_PIXEL ) );
if( aPreviewSizePixel.Width() && aPreviewSizePixel.Height() )
{
const double fWH = static_cast< double >( aPreviewSizePixel.Width() ) / static_cast< double >( aPreviewSizePixel.Height() );
if( fWH <= 1.0 )
aPreviewSizePixel.Width() = static_cast< long >( 128.0 * fWH ), aPreviewSizePixel.Height() = 128;
else
aPreviewSizePixel.Width() = 128, aPreviewSizePixel.Height() = static_cast< long >( 128.0 / fWH );
if( GraphicConverter::Export( aSvOutputStream, aMtfGraphic.GetBitmapEx( &aPreviewSizePixel ), CVT_PNG ) )
{
// handle errror case here
}
else
{
// Success
}
}
Point aInsertPos( rPos ); Point aInsertPos( rPos );
if( pOwnData && pOwnData->GetWorkDocument() ) if( pOwnData && pOwnData->GetWorkDocument() )