/////////////////////////////////////////////////////////////////////////////
-// Name: bitmap.h
+// Name: wx/osx/bitmap.h
// Purpose: wxBitmap class
// Author: Stefan Csomor
// Modified by:
friend class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
public:
- wxBitmap(); // Platform-specific
+ wxBitmap() {} // Platform-specific
// Initialize with raw data.
wxBitmap(const char bits[], int width, int height, int depth = 1);
// Constructor for generalised creation from data
wxBitmap(const void* data, wxBitmapType type, int width, int height, int depth = 1);
+
+ // creates an bitmap from the native image format
+ wxBitmap(CGImageRef image);
// If depth is omitted, will create a bitmap compatible with the display
- wxBitmap(int width, int height, int depth = -1);
+ wxBitmap(int width, int height, int depth = -1) { (void)Create(width, height, depth); }
+ wxBitmap(const wxSize& sz, int depth = -1) { (void)Create(sz, depth); }
// Convert from wxImage:
wxBitmap(const wxImage& image, int depth = -1);
// Convert from wxIcon
wxBitmap(const wxIcon& icon) { CopyFromIcon(icon); }
- virtual ~wxBitmap();
+ virtual ~wxBitmap() {}
wxImage ConvertToImage() const;
// get the given part of bitmap
wxBitmap GetSubBitmap( const wxRect& rect ) const;
- virtual bool Create(int width, int height, int depth = -1);
+ virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
+ virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH)
+ { return Create(sz.GetWidth(), sz.GetHeight(), depth); }
+
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
+ bool Create( CGImageRef image );
+
// virtual bool Create( WXHICON icon) ;
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
// returns a CGImageRef which must released after usage with CGImageRelease
CGImageRef CreateCGImage() const ;
-#if wxOSX_USE_COCOA_OR_IPHONE
+#if wxOSX_USE_COCOA
// returns an autoreleased version of the image
WX_NSImage GetNSImage() const;
+#endif
+#if wxOSX_USE_IPHONE
+ // returns an autoreleased version of the image
+ WX_UIImage GetUIImage() const;
#endif
// returns a IconRef which must be retained before and released after usage
IconRef GetIconRef() const;