This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, July 28, 2004 10:46:41 AM(UTC)
Groups: Registered
Posts: 2
Hello,
I trying to create a thumbnail from a tiff image(700k) to replace an old C dll that creates it for me currently. But when using the ReadThumbnail or SizeCommand I get a jpg that is twice the size (my C dll outputs a 8k jpg file where as LeadTools outputs a 16k jpg file). Also the quality my jpg is much less using LeadTools. I have tried saving using several different jpg formats all with the same results.
Here's the code I'm using:
RasterCodecs rasterCodecs =
new RasterCodecs();
RasterCodecs.CodecsPath = @"C:\Program Files\LEAD Technologies, Inc\Leadtools .NET Class Library\Bin";
string fileName = "c:\\temp\\23473626.tif";
IRasterImage image;
image = rasterCodecs.Load(fileName);
Leadtools.Codecs.CodecsThumbnailOptions ctoThumb =
new CodecsThumbnailOptions();
ctoThumb.Height = 150;
ctoThumb.Width = 100;
ctoThumb.MaintainAspectRatio =
false;
ctoThumb.ForceSize = true;
IRasterImage iThumb = rasterCodecs.ReadThumbnail(fileName, ctoThumb, 1);
rasterCodecs.Save(iThumb, "c:\\temp\\thumb.jpg", RasterImageFormat.Jpeg,8);
or
Leadtools.ImageProcessing.SizeCommand command = new Leadtools.ImageProcessing.SizeCommand();
command.Flags = Leadtools.RasterSizeFlags.Normal;
command.Width = 100;
command.Height = 150;
command.Run(image);
rasterCodecs.Save(image, @"C:\temp\thumb2.jpg", RasterImageFormat.Jpeg, 8);
Thanks!!
Chad Whipple
#2
Posted
:
Wednesday, August 4, 2004 3:16:04 AM(UTC)
Groups: Registered
Posts: 1
I too am having the exact same issue; I'm new to Lead, so I'm keen to get a resolution. The output thumbnail quality (which I can only presume is my fault viz the parameters and method calls) is, for want of a better word, garbage. A large (1600 x 2338 say) b/w tiff is illegible.
Also, this site has my vote for the absolute slowest forum ever - perhaps Lead can buy a new server with my recent license fee.
#3
Posted
:
Monday, August 9, 2004 10:29:34 AM(UTC)
Groups: Registered
Posts: 7
I agree that readthumbnail is low quality and the problem is that the resulting thumbnail is 1bpp.
There are 2 other ways to do it.
The leadtools way involves loading the page in full size mode, then applying an 8 bpp grayscale conversion to it. Then resizing it down to thumbnail size. This results in excellent image quality.
The other way is to load the page in full size mode, then call CreateGDICompatible() etc.. method to get an Image object. Then use the Image object's GetThumbnail() method.
Both of these are pretty slow but have nice quality.
#4
Posted
:
Wednesday, August 24, 2005 9:53:43 PM(UTC)
Groups: Registered
Posts: 5
Is there any way (any control not only lead) which just shows image for given file name and page number for TIFF files? i wanted to use it as THUMBNAIL. My requirement is, I have to show checkbox on top of each ThumbNail so taht user can select any page and submit for deletion or for any other process.
Thanks
Srinivas
#5
Posted
:
Monday, August 29, 2005 5:15:48 AM(UTC)
Groups: Guests
Posts: 3,022
Was thanked: 2 time(s) in 2 post(s)
You can use our ImageList control for this purpose. This control
doesn't provide the check box feature, but you can select multiple
items from the thumbnail list and delete them. Will this do?
Bashar Abdulqaiyume
LEAD Technologies, Inc.
#6
Posted
:
Thursday, January 4, 2007 3:06:53 AM(UTC)
Groups: Registered
Posts: 8
Which is the best way to create thumbnail with best quality and best performance. (Not using listView or not using any windows controls)
~Jijeesh
#7
Posted
:
Thursday, January 4, 2007 3:17:34 AM(UTC)
Groups: Registered
Posts: 8
Oops!! Forgot to include Which tech. I used...
I want code sample in c#
Thanks
Jijeesh
#8
Posted
:
Sunday, January 7, 2007 3:55:04 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
Hello,
Do you mean that you want to create a thumbnail from image file?
If yes, you can use the codecs.ReadThumbnail method.
Please try the following code:
------------------------------
RasterCodecs.Startup();
RasterCodecs codecs = new RasterCodecs();
string srcFileName = @"C:\Program Files\LEAD Technologies\LEADTOOLS 15\Images\Image1.cmp";
// Create a thumbnail with default options
CodecsThumbnailOptions options = CodecsThumbnailOptions.Default;
options.LoadStamp = false;
RasterImage thumbnail = codecs.ReadThumbnail(srcFileName, options, 1);
Console.WriteLine("Thumbnail with default option:");
Console.WriteLine(" Size: {0} by {1} pixels. Bits/Pixel: {2}", thumbnail.Width, thumbnail.Height, thumbnail.BitsPerPixel);
thumbnail.Dispose();
// Create a thumbnail with some options
options.LoadStamp = false;
options.Width = 40;
options.Height = 80;
options.ForceSize = true;
options.MaintainAspectRatio = false;
options.BackColor = RasterColor.FromGdiPlusColor(Color.LightBlue);
options.BitsPerPixel = 8;
thumbnail = codecs.ReadThumbnail(srcFileName, options, 1);
Console.WriteLine("Thumbnail with set option (size: {0} by {1}, Bits/Pixel: {2}, ForeSize: {3}",
options.Width, options.Height, options.BitsPerPixel, options.ForceSize);
Console.WriteLine(" Size: {0} by {1} pixels. Bits/Pixel: {2}", thumbnail.Width, thumbnail.Height, thumbnail.BitsPerPixel);
thumbnail.Dispose();
codecs.Dispose();
RasterCodecs.Shutdown();
------------------------------
If you mean soothing else, please provide me with more details.
Thanks,
Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.