wxLogStatus( _T("Decoding image file...") );
wxYield();
- wxBitmap bitmap( image.ConvertToBitmap() );
+ wxBitmap bitmap( image );
if ( !wxTheClipboard->Open() )
{
wxImage image;
if (image.LoadFile("backgrnd.png", wxBITMAP_TYPE_PNG))
{
- m_background = image.ConvertToBitmap();
+ m_background = wxBitmap(image);
}
MyFrame *frame = new MyFrame();
the first file over the second file. */
if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
{
- DragShape* newShape = new DragShape(image.ConvertToBitmap());
+ DragShape* newShape = new DragShape(wxBitmap(image));
newShape->SetPosition(wxPoint(i*50, i*50));
if (i == 2)
void OnSave(wxCommandEvent& WXUNUSED(event))
{
- wxImage image(m_bitmap);
+ wxImage image = m_bitmap.ConvertToImage();
int bppselection = wxGetSingleChoiceIndex("Set BMP BPP",
"Set BMP BPP",
wxRED_PEN->GetColour().Red(),
wxRED_PEN->GetColour().Green(),
wxRED_PEN->GetColour().Blue() );
- dc.DrawBitmap( i.ConvertToBitmap(), 150, 2010, TRUE );
+ dc.DrawBitmap( wxBitmap(i), 150, 2010, TRUE );
dc.SetTextForeground( wxT("BLACK") );
}
wxRED_PEN->GetColour().Red(),
wxRED_PEN->GetColour().Green(),
wxRED_PEN->GetColour().Blue() );
- dc.DrawBitmap( i.ConvertToBitmap(), 150, 2130, TRUE );
+ dc.DrawBitmap( wxBitmap(i), 150, 2130, TRUE );
dc.SetTextForeground( wxT("BLACK") );
}
blue = blue/4;
anti.SetRGB( x, y, red, green, blue );
}
- my_anti = new wxBitmap( anti.ConvertToBitmap() );
+ my_anti = new wxBitmap(anti);
}
// MyFrame
return;
}
- (new MyImageFrame(this, image.ConvertToBitmap()))->Show();
+ (new MyImageFrame(this, wxBitmap(image)))->Show();
}
//-----------------------------------------------------------------------------
const wxImage& img = wxGetApp().GetImage();
wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), TRUE, &offset);
- wxBitmap bmp = img2.ConvertToBitmap ();
+ wxBitmap bmp(img2);
wxClientDC dc (this);
- dc.DrawBitmap (img2.ConvertToBitmap(), event.m_x + offset.x, event.m_y + offset.y, TRUE);
+ dc.DrawBitmap (bmp, event.m_x + offset.x, event.m_y + offset.y, TRUE);
}
// without interpolation, and without offset correction
const wxImage& img = wxGetApp().GetImage();
wxImage img2 = img.Rotate(frame->m_angle, wxPoint(img.GetWidth()/2, img.GetHeight()/2), FALSE);
- wxBitmap bmp = img2.ConvertToBitmap ();
+ wxBitmap bmp(img2);
wxClientDC dc (this);
dc.DrawBitmap (bmp, event.m_x, event.m_y, TRUE);
for ( size_t n = 0; n < WXSIZEOF(toolBarBitmaps); n++ )
{
toolBarBitmaps[n] =
- wxImage(toolBarBitmaps[n]).Scale(w, h).ConvertToBitmap();
+ wxBitmap(toolBarBitmaps[n].ConvertToImage().Scale(w, h));
}
toolBar->SetToolBitmapSize(wxSize(w, h));
}
else
{
- images->Add(wxImage(icons[i]).Rescale(size, size).
- ConvertToBitmap());
+ images->Add(wxBitmap(icons[i].ConvertToImage().Rescale(size, size)));
}
}
#endif // MSW/!MSW
}
else
{
- images->Add(wxImage(icons[i]).Rescale(size, size).
- ConvertToBitmap());
+ images->Add(wxBitmap(icons[i].ConvertToImage().Rescale(size, size)));
}
}
#endif // MSW/!MSW
/*static*/ void wxMemoryFSHandler::AddFile(const wxString& filename, const wxBitmap& bitmap, long type)
{
- wxImage img(bitmap);
+ wxImage img = bitmap.ConvertToImage();
AddFile(filename, img, type);
}
if (!bitmap.Ok()) return;
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
if (!image.Ok()) return;
#if wxUSE_IMAGE_IN_DRAGIMAGE
// Make the bitmap masked
- wxImage image(bitmap);
+ wxImage image = bitmap.ConvertToImage();
image.SetMaskColour(255, 255, 255);
- bitmap = image.ConvertToBitmap();
+ bitmap = wxBitmap(image);
#endif
return Create(bitmap, cursor);
p1 += 32 * 3, p2 += 32 * 3;
}
- return small.ConvertToBitmap();
+ return wxBitmap(small);
}
// finds empty borders and return non-empty area of image:
m_HashTable.Put(extension, new wxFileIconEntry(newid));
return newid;
}
- wxImage img(ic);
+ wxImage img = ic.ConvertToImage();
delete ft;
int id = m_ImageList.GetImageCount();
if (img.GetWidth() == 16 && img.GetHeight() == 16)
- m_ImageList.Add(img.ConvertToBitmap());
+ m_ImageList.Add(wxBitmap(img));
else
{
if (img.GetWidth() != 32 || img.GetHeight() != 32)
int wxImageList::Add( const wxBitmap& bitmap, const wxColour& maskColour )
{
- wxImage img(bitmap);
+ wxImage img = bitmap.ConvertToImage();
img.SetMaskColour(maskColour.Red(), maskColour.Green(), maskColour.Blue());
- return Add(img.ConvertToBitmap());
+ return Add(wxBitmap(img));
}
const wxBitmap *wxImageList::GetBitmap( int index ) const
m_bitmap = (GdkBitmap*) NULL;
}
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
if (!image.Ok()) return FALSE;
m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, image.GetWidth(), image.GetHeight(), 1 );
// Try to save the bitmap via wxImage handlers:
{
- wxImage image( *this );
+ wxImage image = ConvertToImage();
if (image.Ok()) return image.SaveFile( name, type );
}
{
wxImage image;
if (!image.LoadFile( name, type )) return FALSE;
- if (image.Ok()) *this = image.ConvertToBitmap();
+ if (image.Ok())
+ *this = wxBitmap(image);
else return FALSE;
}
wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,
wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") );
- wxImage image(m_bitmap);
+ wxImage image = m_bitmap.ConvertToImage();
wxCountingOutputStream count;
image.SaveFile(count, wxBITMAP_TYPE_PNG);
memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
memdc.SelectObject(wxNullBitmap);
- wxImage image(bitmap);
+ wxImage image = bitmap.ConvertToImage();
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
return TRUE;
}
wxBitmap use_bitmap;
if ((w != ww) || (h != hh))
{
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
image.Rescale( ww, hh );
if (is_mono)
- use_bitmap = image.ConvertToMonoBitmap(255,255,255);
+ use_bitmap = wxBitmap(image.ConvertToMono(255,255,255), 1);
else
- use_bitmap = image.ConvertToBitmap();
+ use_bitmap = wxBitmap(image);
}
else
{
if ((bm_width != bm_ww) || (bm_height != bm_hh))
{
- wxImage image( memDC->m_selected );
+ wxImage image = memDC->m_selected.ConvertToImage();
image = image.Scale( bm_ww, bm_hh );
if (is_mono)
- use_bitmap = image.ConvertToMonoBitmap(255,255,255);
+ use_bitmap = wxBitmap(image.ConvertToMono(255,255,255), 1);
else
- use_bitmap = image.ConvertToBitmap();
+ use_bitmap = wxBitmap(image);
}
else
{
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
/* scale image */
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
image = image.Scale( ww, hh );
/* convert to bitmap */
- bitmap = image.ConvertToBitmap();
+ bitmap = wxBitmap(image);
/* draw scaled bitmap */
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
minY = (wxCoord)(dmin(y2, dmin(y3, y4)) - 0.5);
// prepare to blit-with-rotate the bitmap to the DC
- wxImage image(src);
+ wxImage image = src.ConvertToImage();
GdkColor *colText = m_textForegroundColour.GetColor(),
*colBack = m_textBackgroundColour.GetColor();
m_bitmap = (GdkBitmap*) NULL;
}
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
if (!image.Ok()) return FALSE;
m_bitmap = gdk_pixmap_new( wxGetRootWindow()->window, image.GetWidth(), image.GetHeight(), 1 );
// Try to save the bitmap via wxImage handlers:
{
- wxImage image( *this );
+ wxImage image = ConvertToImage();
if (image.Ok()) return image.SaveFile( name, type );
}
{
wxImage image;
if (!image.LoadFile( name, type )) return FALSE;
- if (image.Ok()) *this = image.ConvertToBitmap();
+ if (image.Ok())
+ *this = wxBitmap(image);
else return FALSE;
}
wxCHECK_RET( wxImage::FindHandler(wxBITMAP_TYPE_PNG) != NULL,
wxT("You must call wxImage::AddHandler(new wxPNGHandler); to be able to use clipboard with bitmaps!") );
- wxImage image(m_bitmap);
+ wxImage image = m_bitmap.ConvertToImage();
wxCountingOutputStream count;
image.SaveFile(count, wxBITMAP_TYPE_PNG);
memdc.Blit(0, 0, 1, 1, (wxDC*) this, x1, y1);
memdc.SelectObject(wxNullBitmap);
- wxImage image(bitmap);
+ wxImage image = bitmap.ConvertToImage();
col->Set(image.GetRed(0, 0), image.GetGreen(0, 0), image.GetBlue(0, 0));
return TRUE;
}
wxBitmap use_bitmap;
if ((w != ww) || (h != hh))
{
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
image.Rescale( ww, hh );
if (is_mono)
- use_bitmap = image.ConvertToMonoBitmap(255,255,255);
+ use_bitmap = wxBitmap(image.ConvertToMono(255,255,255), 1);
else
- use_bitmap = image.ConvertToBitmap();
+ use_bitmap = wxBitmap(image);
}
else
{
if ((bm_width != bm_ww) || (bm_height != bm_hh))
{
- wxImage image( memDC->m_selected );
+ wxImage image = memDC->m_selected.ConvertToImage();
image = image.Scale( bm_ww, bm_hh );
if (is_mono)
- use_bitmap = image.ConvertToMonoBitmap(255,255,255);
+ use_bitmap = wxBitmap(image.ConvertToMono(255,255,255), 1);
else
- use_bitmap = image.ConvertToBitmap();
+ use_bitmap = wxBitmap(image);
}
else
{
gdk_gc_set_subwindow( m_penGC, GDK_CLIP_BY_CHILDREN );
/* scale image */
- wxImage image( bitmap );
+ wxImage image = bitmap.ConvertToImage();
image = image.Scale( ww, hh );
/* convert to bitmap */
- bitmap = image.ConvertToBitmap();
+ bitmap = wxBitmap(image);
/* draw scaled bitmap */
gdk_draw_pixmap( m_window, m_penGC, bitmap.GetPixmap(), 0, 0, xx, yy, -1, -1 );
minY = (wxCoord)(dmin(y2, dmin(y3, y4)) - 0.5);
// prepare to blit-with-rotate the bitmap to the DC
- wxImage image(src);
+ wxImage image = src.ConvertToImage();
GdkColor *colText = m_textForegroundColour.GetColor(),
*colBack = m_textBackgroundColour.GetColor();
wxImage image;
if ( image.LoadFile( filename, type ) && image.Ok() )
{
- *this = image.ConvertToBitmap();
+ *this = wxBitmap(image);
return TRUE;
}
else
{
// FIXME what about palette? shouldn't we use it?
- wxImage image( *this );
+ wxImage image = ConvertToImage();
if ( image.Ok() )
{
return image.SaveFile(filename, type);
dc2.SelectObject(wxNullBitmap);
// Make the bitmap masked
- wxImage image(bitmap);
+ wxImage image = bitmap.ConvertToImage();
image.SetMaskColour(255, 255, 255);
- bitmap = image.ConvertToBitmap();
-
- return Create(bitmap, cursor);
+ return Create(wxBitmap(image), cursor);
}
// Create a drag image for the given tree control item