G
Guest
hi,
i ve generated a jpeg using the GDI+ library. A part of the code i pasted
below. But surprisingly i am able to see the picture in the windows picture
viewer but i am not able to open it in photoshop. Photoshop gives an error
saying that unexpected end of file was encountered. Did any one of you face
such a problem. Can anyone help with a suitable solution..
below is some part of the code
...........
bmpTemp = New Bitmap(CType(txtWidth.Text, Integer), CType(txtHeight.Text,
Integer))
Dim g As Graphics = Graphics.FromImage(bmpTemp)
g.FillRectangle(oTBrush, 0, 0, bmpTemp.Width, bmpTemp.Height)
g.DrawString(strText, oFontFamily, oForeColor, oXPos, oYPos)
bmpTemp.Save(Request.PhysicalApplicationPath + "temp\temp.jpg", codec,
encoderParametersInstance)
....................
where the codec is "Image/jpeg" and encoderparameterinstance is 100 for
quality and 32 for colordepth..
tia
s
i ve generated a jpeg using the GDI+ library. A part of the code i pasted
below. But surprisingly i am able to see the picture in the windows picture
viewer but i am not able to open it in photoshop. Photoshop gives an error
saying that unexpected end of file was encountered. Did any one of you face
such a problem. Can anyone help with a suitable solution..
below is some part of the code
...........
bmpTemp = New Bitmap(CType(txtWidth.Text, Integer), CType(txtHeight.Text,
Integer))
Dim g As Graphics = Graphics.FromImage(bmpTemp)
g.FillRectangle(oTBrush, 0, 0, bmpTemp.Width, bmpTemp.Height)
g.DrawString(strText, oFontFamily, oForeColor, oXPos, oYPos)
bmpTemp.Save(Request.PhysicalApplicationPath + "temp\temp.jpg", codec,
encoderParametersInstance)
....................
where the codec is "Image/jpeg" and encoderparameterinstance is 100 for
quality and 32 for colordepth..
tia
s