hi..
i was converting xml value to pdf..
while converting this i got this exception"Index and length must refer to a location within the string. Parameter name: length"..
this is my code:
private static Bitmap returnBitMap(string sPixelData, Bitmap oBitmap, int iWidth, int iHeight)
{
try
{
iWidth=400;
iHeight=700;
string sCurrentPixelColor = String.Empty;
if (sPixelData != String.Empty)
{
oBitmap = new Bitmap(iWidth, iHeight);
int i = 0;
for (int ix = 0; ix < iHeight; ix++)
{
for (int iy = 0; iy < iWidth; iy++)
{
sCurrentPixelColor = sPixelData.Substring(i * 6, 6);
oBitmap.SetPixel(iy, ix, ColorTranslator.FromHtml("0x" + sCurrentPixelColor));
i++;
}
}
}
return oBitmap;
}
catch (Exception ex)
{
throw ex;
}
}
-----------------
how to handle this..
need ur suggestions..
regards
gopal.s