MerlinEl
10-16-2009, 11:30 PM
Hi
1) Im try to save a Jpeg files in to Gif format
2) and after pack them to animated Gif
1) allmost done , but I cant solve why my saved gif images is so compressed.
http://img266.imageshack.us/img266/8582/mygrabfile.gif
fn convertJpegToGiff jpg_filename =
(
--create an Image dotNetClass
image_class = dotNetClass "System.Drawing.Image"
--get the saved image from file as bitmap
dotnet_bitmap = image_class.FromFile jpg_filename
--create a new GIF filename
gif_filename = (getFilenamePath jpg_filename) + (getFilenameFile jpg_filename) + ".gif"
w=dotnet_bitmap.width
h=dotnet_bitmap.height
-- left top right bottom
rect = (dotNetClass "System.Drawing.Rectangle").FromLTRB 0 0 w h
bit_24 = (dotNetClass "System.Drawing.Imaging.PixelFormat").Format24bppRgb
dotnet_bitmap_24bit = dotnet_bitmap.clone rect bit_24 --clone bitmap to 24_bit
img_format = dotNetClass "System.Drawing.Imaging.ImageFormat" -- file formats
dotnet_bitmap_24bit.save gif_filename img_format.gif --save jpg as gif
dotnet_bitmap.Dispose()
dotnet_bitmap_24bit.Dispose()
deleteFile jpg_filename
)
thanks for the help
1) Im try to save a Jpeg files in to Gif format
2) and after pack them to animated Gif
1) allmost done , but I cant solve why my saved gif images is so compressed.
http://img266.imageshack.us/img266/8582/mygrabfile.gif
fn convertJpegToGiff jpg_filename =
(
--create an Image dotNetClass
image_class = dotNetClass "System.Drawing.Image"
--get the saved image from file as bitmap
dotnet_bitmap = image_class.FromFile jpg_filename
--create a new GIF filename
gif_filename = (getFilenamePath jpg_filename) + (getFilenameFile jpg_filename) + ".gif"
w=dotnet_bitmap.width
h=dotnet_bitmap.height
-- left top right bottom
rect = (dotNetClass "System.Drawing.Rectangle").FromLTRB 0 0 w h
bit_24 = (dotNetClass "System.Drawing.Imaging.PixelFormat").Format24bppRgb
dotnet_bitmap_24bit = dotnet_bitmap.clone rect bit_24 --clone bitmap to 24_bit
img_format = dotNetClass "System.Drawing.Imaging.ImageFormat" -- file formats
dotnet_bitmap_24bit.save gif_filename img_format.gif --save jpg as gif
dotnet_bitmap.Dispose()
dotnet_bitmap_24bit.Dispose()
deleteFile jpg_filename
)
thanks for the help
