Select to view content in your preferred language

Axmapcontrol is flicking

829
4
10-29-2013 02:09 AM
onurbeyaz
Emerging Contributor
hi,

I m using Arcgis 10.1 engine.

On my program, when I refresh axmapcontrol, axmapcontrol is flicking. Please someone help me.
0 Kudos
4 Replies
AlexanderGray
Honored Contributor
It depends on what you need to refresh.  By refreshing everyting, everything gets redrawn so flickering will happen.  If you look at the mapclass you can get from the map control, there is an IViewRefresh interface that has a partial referesh and other methods to better contain the scope of the refresh.
0 Kudos
onurbeyaz
Emerging Contributor
thank you for answer ,I tried but it doesn't work. Here is my code :
private void timer1_tick(object sender, EventArgs e)
{
if(checkBox_rotate_map.Checked)
{
axmapControl1.Rotation = angle;
angle = (angle+5 )%360;

axmapControl1.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewBackground,null,null);
}
else 
{
axmapControl1.Rotation=0;
}
}


Timer interval =100;  and axmapcontrol size 1000x500;
0 Kudos
AlexanderGray
Honored Contributor
ya, if you refresh the background, it is going to refresh everything. 
Think of a map as a series of transparent layers one ontop of the others.  If you want to refresh to top layer (foreground), no problem, just remove the top layer, throw it away and make a new one and place it on top.  If you want to refresh a middle layer (geo selection for example), you throw away that layer and everything on top, graphics, graphics selection, foreground and redraw all those, you keep those bellow.  The background is like the bottom layer so there is not much to save with a partial refresh, specially since you don't pass in an extent to limit it (null means refresh everything.)  You might want to look at basemap layers to improve rendering.
0 Kudos
onurbeyaz
Emerging Contributor
but, When I tried this code with Arcgis 10.0 , it was running without flicking.
0 Kudos