Drawing in mCarbonWindow doesn't show
Drawing in mCarbonWindow doesn't show
- Subject: Drawing in mCarbonWindow doesn't show
- From: Rémi Thébault <email@hidden>
- Date: Fri, 2 Nov 2007 03:55:05 +0100
Hello everybody
I started a new project from template "AudioUnit with Carbon View".
Now I'd like to draw some custom shapes in it (I'll begin with
rectangles).
I wrote this :
UInt32 xPanelOffset = 0;
UInt32 yPanelOffset = 0;
if (mAUView->IsCompositWindow ()) {
xPanelOffset = mAUView->GetXOffset();
yPanelOffset = mAUView->GetYOffset();
}
Rect r = { mPitchBarRect.top + yPanelOffset, mPitchBarRect.left +
xPanelOffset,
mPitchBarRect.bottom + yPanelOffset,
mPitchBarRect.left+ xPanelOffset };
RGBForeColor(&mPitchBarColor);
PaintRect(&r);
and I tried with Quartz 2D as well :
CGContextRef myContext;
SetPortWindowPort(mAUView->mCarbonWindow);
QDBeginCGContext (GetWindowPort (mAUView->mCarbonWindow),
&myContext);
CGContextSetRGBFillColor (myContext, 1, 0, 0, 1);
CGContextFillRect (myContext, CGRectMake (0, 0, 200, 100));
CGContextSetRGBFillColor (myContext, 0, 0, 1, .5);
CGContextFillRect (myContext, CGRectMake (0, 0, 100, 200));
CGContextFlush(myContext);
QDEndCGContext (GetWindowPort(mAUView->mCarbonWindow),
&myContext);
}
But the rectangles refuse to show though the controls (static text and
others) are showing properly.
Any ideas ?
Rémi Thébault
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden