+#if wxUSE_NANOX
+ if (!image.Ok())
+ {
+ wxASSERT_MSG(image.Ok(), "Invalid wxImage passed to wxBitmap::CreateFromImage.");
+ return FALSE;
+ }
+
+ int w = image.GetWidth();
+ int h = image.GetHeight();
+
+ if (!Create(w, h, depth))
+ return FALSE;
+
+ wxMemoryDC memDC;
+ memDC.SelectObject(*this);
+
+ // Warning: this is very inefficient.
+ wxPen pen;
+ pen.SetStyle(wxSOLID);
+ pen.SetWidth(1);
+
+ int i, j;
+ for (i = 0; i < w; i++)
+ {
+ for (j = 0; j < h; j++)
+ {
+ unsigned char red = image.GetRed(i, j);
+ unsigned char green = image.GetGreen(i, j);
+ unsigned char blue = image.GetBlue(i, j);
+ wxColour colour(red, green, blue);
+
+ pen.SetColour(colour);
+ memDC.SetPen(pen);
+ memDC.DrawPoint(i, j);
+
+#if 0
+ if (hasMask)
+ {
+ // scan the bitmap for the transparent colour and set the corresponding
+ // pixels in the mask to BLACK and the rest to WHITE
+ if (maskR == red && maskG == green && maskB == blue)
+ ::SetPixel(hMaskDC, i, j, PALETTERGB(0, 0, 0));
+ else
+ ::SetPixel(hMaskDC, i, j, PALETTERGB(255, 255, 255));
+ }
+#endif
+ }
+ }
+ memDC.SelectObject(wxNullBitmap);
+
+ return TRUE;
+#else
+ // !wxUSE_NANOX
+