drawImageAt draws funny coloured image


I have a juce component that I have added as a child window to another window by doing to the following:

editor = new Editor();

HWND editorWnd = (HWND)editor->getWindowHandle();

SetParent (editorWnd, gWin32Window);

DWORD val = GetWindowLong (editorWnd, GWL_STYLE);
val = (val & ~WS_POPUP) | WS_CHILD;
SetWindowLong (editorWnd, GWL_STYLE, val);

If my paint function looks like this, it paints fine the first time, but then after calling repaint it looks odd.

void Editor::paint(Graphics& g)
	g.drawImageAt(background, 0, 0);

If my paint function looks like this, then it works ok and looks like this:

void Editor::paint(Graphics& g) { g.fillAll(Colours::black); g.drawImageAt(background, 0, 0); }

The component is opaque. This is with the latest SVN code. Any idea what is going wrong?


Is the background image partially transparent?


Ah, that’s it. Thanks.