source_data += source_step;
target_data += target_step;
}
+ return;
}
- else
+
+ if (!HasMask() && image.HasMask())
{
+ unsigned char r = image.GetMaskRed();
+ unsigned char g = image.GetMaskGreen();
+ unsigned char b = image.GetMaskBlue();
+
+ width *= 3;
+ unsigned char* source_data = image.GetData() + xx*3 + yy*3*image.GetWidth();
+ int source_step = image.GetWidth()*3;
+
+ unsigned char* target_data = GetData() + (x+xx)*3 + (y+yy)*3*M_IMGDATA->m_width;
+ int target_step = M_IMGDATA->m_width*3;
+
+ for (int j = 0; j < height; j++)
+ {
+ for (int i = 0; i < width; i+=3)
+ {
+ if ((source_data[i] != r) &&
+ (source_data[i+1] != g) &&
+ (source_data[i+2] != b))
+ {
+ memcpy( target_data+i, source_data+i, 3 );
+ }
+ }
+ source_data += source_step;
+ target_data += target_step;
+ }
}
}
#ifdef __WXMAC__
-#include <PictUtils.h>
+#ifdef __UNIX__
+ #include <QD/PictUtils.h>
+#else
+ #include <PictUtils.h>
+#endif
extern CTabHandle wxMacCreateColorTable( int numColors ) ;
extern void wxMacDestroyColorTable( CTabHandle colors ) ;
extern void wxMacSetColorTableEntry( CTabHandle newColors , int index , int red , int green , int blue ) ;
-extern GWorldPtr wxMacCreateGWorld( int height , int width , int depth ) ;
+extern GWorldPtr wxMacCreateGWorld( int width , int height , int depth ) ;
extern void wxMacDestroyGWorld( GWorldPtr gw ) ;
wxBitmap wxImage::ConvertToBitmap() const
}
wxCHECK_RET( gdk_image, wxT("couldn't create image") );
-
+
Create( bitmap.GetWidth(), bitmap.GetHeight() );
char unsigned *data = GetData();