Blinking a Symbol in background

970
3
04-02-2013 11:12 PM
Santosh_Pavan_KumarNukala
New Contributor III
Hi/Hola/Namaste,

I am currently trying to blink a symbol which is displayed as a graphic element using PictureMarkerSymbol. I have Used FlashShape() funtion to blink the symbol, I am able to blink the symbol but as long as the symbol blinks I cannot do any other operation on the mapcontrol. Please let me know how can make the PictureMarkerSymbol blink constantly as a background process so that it doesnt hinder other operations. Also I am able to blink the symbol for specific number of times only as an argument in FlashShape function. Please let me know how can I blink the symbol continuously without stopping. The code is below:
// *********************
            IPoint pt = new PointClass();
            pt.X = 58.5;
            pt.Y = 27.5;

            //Plot Marker Symbol      
            IMarkerElement pMrkElement = new MarkerElementClass();

            System.Drawing.Bitmap dotNetBmp = new System.Drawing.Bitmap(@"D:\Symbols\Sample.bmp");
            ESRI.ArcGIS.Display.IPictureMarkerSymbol bmpSym = new ESRI.ArcGIS.Display.PictureMarkerSymbolClass() as ESRI.ArcGIS.Display.IPictureMarkerSymbol;
            bmpSym.Picture = ESRI.ArcGIS.ADF.COMSupport.OLE.GetIPictureDispFromBitmap(dotNetBmp) as stdole.IPictureDisp;
            bmpSym.BitmapTransparencyColor = GetRGBColor(255, 255, 255);
            bmpSym.Size = 18;
            IMarkerSymbol markerSymbol = bmpSym as IMarkerSymbol;
            pMrkElement.Symbol = markerSymbol;
// Blink the Symbol.
            axMapControl1.FlashShape(pt, 30, 100, bmpSym);


Thanks in Advance/ Gracias,
Santosh
0 Kudos
3 Replies
Santosh_Pavan_KumarNukala
New Contributor III
Can someone please help on this.. not getting much help from internet as well .. Kindly help 😞
0 Kudos
Santosh_Pavan_KumarNukala
New Contributor III
There was a similar question in the forum previously which is left unanswered .. can some one please please please answer or throw some light on this...    http://forums.esri.com/Thread.asp?c=159&f=1707&t=276664
0 Kudos
JasonPike
Occasional Contributor
As someone pointed out on the old forum, your approach would involve threading. Not all of the objects the ArcObjects API are thread safe. Non-thread safe objects cannot be manipulated by multiple threads simultaneously. If you try to do it anyway, you'll end up with instability that usually results in the process hanging or throwing access violations. All that to say, I don't think what you're trying to do is supported.

However, you might want to look into things like the ITimeDataDisplay interface and ArcMap's animation capabilities.
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001200000r99000000
http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#/ESRI_ArcGIS_AnimationUI...

Good luck! Please keep the forum informed on your progress.
0 Kudos