I am trying to set a Background Image for a Angular Meter but all my attempts failed so far.
The Image is a 1024x1024px PNG with Transparency, located in the Resources Folder of the OS X App Bundle.
I am using the following code to create the Meter with an Image Mask:
[code] dim m as new CDAngularMeterMBS(1024, 1024, CDBaseChartMBS.kTransparent, CDBaseChartMBS.kTransparent, 0)
m.setMeter(512, 512, 502, -135, 135)
m.setScale(0, 100, 10)
m.setLineWidth(0, 3, 0)
call m.addPointer(value, &c19191900, &c19191900)
Dim CPUChartPicture As New Picture(1024, 1024, 32)
CPUChartPicture=m.makeChartPicture
Dim CPUChartMask As New Picture(1024, 1024, 32)
CPUChartMask.Graphics.ForeColor = &c00000000
CPUChartMask.Graphics.FillOval(10, 10, 1004, 1004)
CPUChartPicture.ApplyMask(CPUChartMask)[/code]
I tried to add a BgImage like this:
Dim f As FolderItem
f = App.ExecutableFile.Parent.Parent.Child("Resources").Child("speed_1.png")
MeterBackground = MeterBackground.Open(f) // MeterBackground is a Property of the Window
m.setBgImage(MeterBackground.GetData(Picture.FormatPNG))
But the result is just a black filled circle including the Pointer drawed by Chart Director.
Where and how can i load and add the image as a BgImage to this Meter please?