drawImageAt draws funny coloured image


#1

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

editor = new Editor();
editor->addToDesktop(0);

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.setColour(Colours::black);
	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?


#2

Is the background image partially transparent?


#3

Ah, that’s it. Thanks.