It's possible now to save to a PNG. OK, I still

have performance problems, but it's a start.
  Updated install.txt.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@662 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1998-09-03 21:46:47 +00:00
parent 24d20a8f73
commit cf7a7e133b
17 changed files with 487 additions and 63 deletions

View File

@@ -124,10 +124,12 @@ wxPaintDC::~wxPaintDC(void)
void wxPaintDC::FloodFill( long WXUNUSED(x1), long WXUNUSED(y1),
wxColour *WXUNUSED(col), int WXUNUSED(style) )
{
wxFAIL_MSG( "wxPaintDC::FloodFill not implemented" );
}
bool wxPaintDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
wxFAIL_MSG( "wxPaintDC::GetPixel not implemented" );
return FALSE;
}
@@ -135,6 +137,8 @@ void wxPaintDC::DrawLine( long x1, long y1, long x2, long y2 )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_pen.GetStyle() != wxTRANSPARENT)
{
gdk_draw_line( m_window, m_penGC,
@@ -146,6 +150,8 @@ void wxPaintDC::CrossHair( long x, long y )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_pen.GetStyle() != wxTRANSPARENT)
{
int w = 0;
@@ -164,6 +170,8 @@ void wxPaintDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double y
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
long xx2 = XLOG2DEV(x2);
@@ -212,6 +220,8 @@ void wxPaintDC::DrawEllipticArc( long x, long y, long width, long height, double
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
@@ -234,6 +244,8 @@ void wxPaintDC::DrawPoint( long x, long y )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
}
@@ -242,6 +254,8 @@ void wxPaintDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_pen.GetStyle() == wxTRANSPARENT) return;
for (int i = 0; i < n-1; i++)
@@ -258,6 +272,8 @@ void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_pen.GetStyle() == wxTRANSPARENT) return;
wxNode *node = points->First();
@@ -274,10 +290,12 @@ void wxPaintDC::DrawLines( wxList *points, long xoffset, long yoffset )
}
}
void wxPaintDC::DrawPolygon( int n, wxPoint points[],
long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
if (!Ok()) return;
void wxPaintDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (!n) return; // Nothing to draw
GdkPoint *gdkpoints = new GdkPoint[n+1];
int i;
@@ -299,12 +317,13 @@ void wxPaintDC::DrawPolygon( int n, wxPoint points[],
delete[] gdkpoints;
}
void wxPaintDC::DrawPolygon( wxList *lines, long xoffset,
long yoffset, int WXUNUSED(fillStyle))
{
void wxPaintDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
int n = lines->Number();
if (!Ok()) return;
GdkPoint *gdkpoints = new GdkPoint[n];
wxNode *node = lines->First();
int cnt=0;
@@ -336,6 +355,8 @@ void wxPaintDC::DrawRectangle( long x, long y, long width, long height )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
@@ -359,6 +380,8 @@ void wxPaintDC::DrawRoundedRectangle( long x, long y, long width, long height, d
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (radius < 0.0) radius = - radius * ((width < height) ? width : height);
long xx = XLOG2DEV(x);
@@ -424,6 +447,8 @@ void wxPaintDC::DrawEllipse( long x, long y, long width, long height )
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
long ww = m_signX * XLOG2DEVREL(width);
@@ -451,6 +476,8 @@ void wxPaintDC::DrawIcon( const wxIcon &icon, long x, long y, bool useMask )
if (!icon.Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
int xx = XLOG2DEV(x);
int yy = YLOG2DEV(y);
@@ -478,21 +505,22 @@ bool wxPaintDC::Blit( long xdest, long ydest, long width, long height,
{
if (!Ok()) return FALSE;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
// CMB 20/5/98: add blitting of bitmaps
if (source->IsKindOf(CLASSINFO(wxMemoryDC)))
{
wxMemoryDC* srcDC = (wxMemoryDC*)source;
GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
GdkBitmap* bmap = srcDC->m_selected.GetBitmap();
if (bmap)
{
gdk_draw_bitmap (
m_window,
m_textGC,
bmap,
source->DeviceToLogicalX(xsrc), source->DeviceToLogicalY(ysrc),
XLOG2DEV(xdest), YLOG2DEV(ydest),
source->DeviceToLogicalXRel(width), source->DeviceToLogicalYRel(height)
);
gdk_draw_bitmap( m_window, m_textGC, bmap,
source->DeviceToLogicalX(xsrc),
source->DeviceToLogicalY(ysrc),
XLOG2DEV(xdest),
YLOG2DEV(ydest),
source->DeviceToLogicalXRel(width),
source->DeviceToLogicalYRel(height) );
return TRUE;
}
}
@@ -519,6 +547,8 @@ void wxPaintDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(us
{
if (!Ok()) return;
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
GdkFont *font = m_font.GetInternalFont( m_scaleY );
x = XLOG2DEV(x);
@@ -588,7 +618,7 @@ void wxPaintDC::Clear(void)
{
if (!Ok()) return;
// DestroyClippingRegion();
if (!m_isDrawable) ((wxMemoryDC*)this)->m_selected.DestroyImage();
if (m_isDrawable)
{