OOFILE  1.9
Public Member Functions | Static Public Member Functions | List of all members

Cross-platform picture representation can load from file or resource and draw. More...

#include <oofdraw.h>

Public Member Functions

oofPictclone () const
 
void draw (int x, int y, int right, int bottom, bool onPrinter=false)
 
 oofPict (const oofFileRef &)
 
 oofPict (const oofPict &)
 
 oofPict (unsigned long PICTresourceID)
 
 ~oofPict ()
 
Secondary JPEG access
void loadSecondaryJPEG (const oofFileRef &)
 
bool hasJPEG () const
 
const char * bufOfJPEG () const
 
unsigned long bytesInJPEG () const
 
getters
GWorldPtr gWorld ()
 
unsigned long height ()
 
unsigned long width ()
 
oofString describe () const
 

Static Public Member Functions

static PicHandle readPict (const oofFileRef &)
 

Detailed Description

Cross-platform picture representation can load from file or resource and draw.

Allows you to specify a JPEG filename and store JPEG in parallel to original bitmap so oofPict being exported to RTF or HTML can use optimal representation.

Windows Bitmaps
Under original Win32 version a bitmap is a bitmap. At some point (98 and 2000 or NT4 SP6 onwards) a bitmap became able to be of type JPEG. Windows 98/Me, Windows 2000/XP: SetDIBitsToDevice or StretchDIBits can send a JPEG or PNG directly to a printer, if the printer hardware supports it. This extended format behaviour is indicated if the biCompression member of BITMAPINFOHEADER is BI_JPEG or BI_PNG.
Todo:
implement ctor loading from resource ID for Windows whem oofDIB able to load from resource.
Todo:
if have JPEG, use that when drawing to printers if possible (see Platform SDK discussion Graphics & Multimedia Services / Windows GDI / Bitmaps)
Todo:
reimplement this and possibly report drawing with GDI+ because it looks a lot nicer!

Definition at line 201 of file oofdraw.h.

Constructor & Destructor Documentation

oofPict::oofPict ( const oofFileRef inFile)

Definition at line 1179 of file oofdraw.cpp.

Referenced by clone().

oofPict::oofPict ( const oofPict rhs)

Definition at line 1193 of file oofdraw.cpp.

References OOF_mixRefCount::incRefs().

oofPict::oofPict ( unsigned long  PICTresourceID)

Definition at line 1137 of file oofdraw.cpp.

oofPict::~oofPict ( )

Definition at line 1216 of file oofdraw.cpp.

References OOF_mixRefCount::decRefs().

Member Function Documentation

const char * oofPict::bufOfJPEG ( ) const
inline

Definition at line 409 of file oofdraw.h.

References oofSharedBLOB::bodyAddress().

Referenced by oofRepRTFEnv::encodeToRTFStream().

unsigned long oofPict::bytesInJPEG ( ) const
inline

Definition at line 416 of file oofdraw.h.

References oofSharedBLOB::bodyLength().

Referenced by oofRepRTFEnv::encodeToRTFStream().

oofPict * oofPict::clone ( ) const

Definition at line 1234 of file oofdraw.cpp.

References oofPict().

Referenced by OOF_mixPictOwner::OOF_mixPictOwner().

oofString oofPict::describe ( ) const

Definition at line 1262 of file oofdraw.cpp.

References oofString::convertNumber(), and oofFileRef::path().

Referenced by oofRepPictBlock::getCellText().

void oofPict::draw ( int  x,
int  y,
int  right,
int  bottom,
bool  onPrinter = false 
)
GWorldPtr oofPict::gWorld ( )
inline

Definition at line 388 of file oofdraw.h.

References OOF_GWorldOwner::gWorld().

bool oofPict::hasJPEG ( ) const
inline

Definition at line 403 of file oofdraw.h.

References oofSharedBLOB::isLoaded().

Referenced by oofRepRTFEnv::encodeToRTFStream().

unsigned long oofPict::height ( )

Definition at line 1241 of file oofdraw.cpp.

Referenced by OOF_mixPictOwner::height().

void oofPict::loadSecondaryJPEG ( const oofFileRef inFile)

Definition at line 1487 of file oofdraw.cpp.

References OOF_mixRefCount::decRefs(), and oofFileRef::readBinary().

PicHandle oofPict::readPict ( const oofFileRef inRef)
static

Definition at line 1348 of file oofdraw.cpp.

References oofFileRef::isValid(), and oofFileRef::spec().

unsigned long oofPict::width ( )

Definition at line 1251 of file oofdraw.cpp.

Referenced by oofRepPictBlock_WinRender::draw(), and OOF_mixPictOwner::width().


The documentation for this class was generated from the following files: