Hello,
i have a problem. I created photo as imagemap and i'd like to create
hotspots location depending on some values. So at start i have static
class where i put all values:
class ExtraMethods {
public static int[] xWaw = { 230, 130, 230, 230, 120 };
public static int[] yWaw = { 260, 530, 480, 100, 160 };
}
And after every postback i assign to local variables those values:
private void Page_Load(object sender, System.EventArgs e)
{
if (this.IsPostBack == false)
{
;
}
else
{
xWaw = ExtraMethods.xWaw;
yWaw = ExtraMethods.yWaw;
RecalculatePoints();
}
}
And i have function which recalculate points of hotspots:
public void RecalculatePoints()
{
int[] xTmp = new int[5];
int[] yTmp = new int[5];
int xCenter = 450;
int yCenter = 300;
for (int s = 0; s < 5; s++)
{
xTmp[s] = xCenter - xWaw[s];
yTmp[s] = yCenter - yWaw[s];
xTmp[s] = Convert.ToInt32(xTmp[s] / scale[5 -
ExtraMethods.zoomInOut]);
yTmp[s] = Convert.ToInt32(yTmp[s] / scale[5 -
ExtraMethods.zoomInOut]);
xWaw[s] = xCenter - xTmp[s];
yWaw[s] = yCenter - yTmp[s];
}
}
And this method uses scale factor:
float[] scale = { 1f , 2f , 3f , 4f , 5f };
So, after i start debugging i get everything working fine. But when i'm
going recalcutation my website remember local values: xWaw and yWaw,
even if as i can understand i'm retrieving right info and in the same
time values from this extraclass are changed - nowhere in my code those
values are on the left side of =.
What i'm doing wrong? Maybe somebody can help me?
Thanks
Piotrek