hey,
thanks for the new matrix.It helped..
But i have a new issue now..m unable to save this image in grayscale
format..
when i check the file properties...using the follwing method
---------------------------------
Public Sub modInfo(ByVal infile As String)
Try
Dim oreg As RegistryKey
Dim ffile As New FileInfo(infile)
Dim instrm As New FileStream(infile, FileMode.Open)
Dim img As Image = Image.FromStream(instrm)
Dim pos As Integer = 0
'file properties
intfilesize = CInt(ffile.Length)
strfullname = ffile.FullName
strtype = ffile.Extension.ToString
ffile = Nothing
oreg = Registry.ClassesRoot.OpenSubKey(strtype)
If oreg Is Nothing Then
strtype = "UnKnown"
Else
strtype = oreg.GetValue("").ToString
oreg = Registry.ClassesRoot.OpenSubKey(strtype)
strtype = oreg.GetValue("", "").ToString
End If
oreg.Close()
'image properties
intwidth = CInt(img.Width)
intheight = CInt(img.Height)
strimgformat = img.PixelFormat.ToString
pos = strimgformat.LastIndexOf("p")
strimgformat = strimgformat.Substring(pos + 1)
strbitsperpixel = Image.GetPixelFormatSize(img.PixelFormat)
intHorRes = img.HorizontalResolution
intVerRes = img.VerticalResolution
instrm.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
---------------------------------
, then the pixel format comes out to be 32 bit..non-grayscale...It just
doesn't seem to save correctly..The file generated when saved using the
bitmap's save method..doesn't even open in Photo editor..(It shows an
error)
--> My question is how to save this grayscale file in 8 bits.
and i have a new question...
How do i convert a 24-bit image to 8-bit image (no grayscaling) and
vice-versa.....and save it as 24/8 bit..(should save correctly).
< --HELP-->
regards
Himani