一个自动动态播放图片的类(downmoon)新增图片效果

第一步:创建一个类clsTurnPicture

增加方法如下 :

/**/ ///
///播放图片类(downmoon)
///

///arrImgName
///arrDesc
///strShopName
///strBrandName
///strResoourceCode
///ScrWidth
///ScrHeight
///PicWidth
///PicHeight
///TextHeight
///ToolBarHeight
///默认为16,px
///

public string getPicsForHtml(ArrayListarrImgName,ArrayListarrDesc, string strShopName, string strBrandName, string strResoourceCode, int ScrWidth, int ScrHeight, int PicWidth, int PicHeight, int TextHeight, int ToolBarHeight, int FontSize)
... {
StringBuildersb
=newStringBuilder();
stringstrHtml="";
if(arrImgName==null)return"";
ArrayListar1
=newArrayList(arrImgName);
ArrayListar2
=newArrayList(arrDesc);
intlen=ar1.Count;
intlen2=ar1.Count-1;
intlen3=ToolBarHeight-2;
stringstr1="";
stringstr2="";

//strHtm+=@"Buynow{0}-{1}-{2}图片信息
strHtml=@"</span><span style="color:#000000;">"</span><span style="color:#000000;">+</span><span style="color:#000000;">strShopName</span><span style="color:#000000;">+</span><span style="color:#000000;">"</span><span style="color:#000000;">-</span><span style="color:#000000;">"</span><span style="color:#000000;">+</span><span style="color:#000000;">strBrandName</span><span style="color:#000000;">+</span><span style="color:#000000;">"</span><span style="color:#000000;">-</span><span style="color:#000000;">"</span><span style="color:#000000;">+</span><span style="color:#000000;">"</span><span style="color:#000000;">席位:</span><span style="color:#000000;">"</span><span style="color:#000000;">+</span><span style="color:#000000;">strResoourceCode</span><span style="color:#000000;">+</span><span style="color:#000000;"></span><span style="color:#000000;">"</span><span style="color:#000000;">-外观展示图</span><span style="color:#000000;">"</span><span style="color:#000000;">+</span><span style="color:#000000;"><br><img src="http://img.e-com-net.com/image/info8/30b3da7787b24a2b9dc5b44c8de3f160.gif" alt="" align="top" width="0" height="0"></span><span style="color:#000000;">@"</span><span style="color:#000000;">




"+System.Environment.NewLine;

sb.Append(strHtml);
sb.Append(
""+" ");
sb.Append(
"



";
sb.Append(strHtml);
strHtml
=@"";

sb.Append(strHtml);
strHtml
=@"


"
+ScrWidth.ToString()+@"'>






"+
PicHeight.ToString()
+"'width='"+PicWidth.ToString()+@"'align='center'>

"+

ar1[
0].ToString()+"'width='"+PicWidth+"'height='"+PicHeight+@"'οnlοad=""counternum();""border='0'style='FILTER:revealTrans(duration=3,transition=20)'>






"+
TextHeight.ToString()
+"'style='font-size:"+FontSize.ToString()+"pt;'>"

+strShopName+"-"+strBrandName+"-"+strResoourceCode+"-"+ar2[0].ToString()+@"









"+ToolBarHeight.ToString()+@"'>


"+len3.ToString()+"'>"+FontSize+"pt;'>1/"+len.ToString()+

@"    
  
      速度:

12sec.
6sec.
3sec.
9sec.















flagtime=1;
rotateImage();//修改为图片自动播放



";
sb.Append(strHtml);
sb.Append(
"");
returnsb.ToString();


}


调用格式:

/**/ ////ArrayListar1=newArrayList();
////ar1.Clear();
////ar1.Add("http://downmoon-hgh/RichChartServer/Top30/frmForumDisplayImage.aspx?id=160720060328095407");
////ar1.Add("http://downmoon-hgh/RichChartServer/Top30/frmForumDisplayImage.aspx?id=160420060327085709");
////ar1.Add("http://downmoon-hgh/RichChartServer/Top30/frmForumDisplayImage.aspx?id=160420060327091030");
////ar1.Add("http://downmoon-hgh/RichChartServer/Top30/frmForumDisplayImage.aspx?id=160420060327092445");
////
////drawPic(ar1);



if ( this .ar1 == null || ar1.Count == 0 )
... {
//this.MsgBox("该席位/资源无外观图!");
//this.CloseWebForm();
return;
}

else
... {

drawPic(ar1);
}



private void drawPic(ArrayListarrImages)
... {
if(pic==null)
...{
pic
=newclsTurnPicture();
}

inti;
ArrayListar2
=newArrayList();
ar2.Clear();
for(intk=0;k<arrImages.Count;k++)
...{i=k+1;
ar2.Add(
"展示图"+i.ToString());
}

Response.Write(pic.getPicsForHtml(arrImages,ar2,CurrShopName,CurBrandName,strResourceCode,
1024,768,1022,640,36,34,16));


}

你可能感兴趣的:(一个自动动态播放图片的类(downmoon)新增图片效果)