private void UpdateNeedleBitmap() { if (m_needleBitMap != null && m_isCustomNeedleEnabled) { /* We use bitmap needle.*/ /* TODO : This probably no longer works and should be reviewed. */ int ResizedWidth = (int)(m_needleBitMap.Width * (ResizeScale / 100)); int ResizedHeight = (int)(m_needleBitMap.Height * (ResizeScale / 100)); ResizedNeedleBitMap = new Bitmap((int)Width, (int)Height); Graphics graph = Graphics.FromImage(ResizedNeedleBitMap); graph.DrawImage(m_needleBitMap, new RectangleF((Width / 2) - NeedleCenterPoint.X, (Height / 2) - NeedleCenterPoint.Y, ResizedWidth, ResizedHeight)); mainNeedle = new ImageGaugeNeedle(ResizedNeedleBitMap, CenterPoint); } else { /* We use the default needle. */ mainNeedle = m_simpleNeedle; } Refresh(); }
public void AddCustomNeedle(string name, GaugeNeedle needle) { customNeedleDictionary.Add(name, needle); }