P
Piotrek \Alchemik\
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 = xCenter - xWaw;
yTmp = yCenter - yWaw;
xTmp = Convert.ToInt32(xTmp / scale[5 -
ExtraMethods.zoomInOut]);
yTmp = Convert.ToInt32(yTmp / scale[5 -
ExtraMethods.zoomInOut]);
xWaw = xCenter - xTmp;
yWaw = yCenter - yTmp;
}
}
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
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
yTmp
xTmp
ExtraMethods.zoomInOut]);
yTmp
ExtraMethods.zoomInOut]);
xWaw
yWaw
}
}
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