Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, February 1, 2011 3:31:02 AM(UTC)

Groups: Registered
Posts: 11

I am using .net4.0(c#) and leadtools v17
I want to resize and compress the image and upload into website using leadtool.
Please tel me how to do this ?

I have writter in windowsapplication
when i open the website in visualstudio leadtools controls are not visible in toolbox.

I wrote in the following approach using windowsapplication, this process is correct or not
if not, tel me correct process

RasterCodecs codecs= new RasterCodecs();
OpenFileDialog dlg = new OpenFileDialog();
dlg.Filter = "All Files|*.*";
//Resize the Image
RasterImage srcFileName = codecs.Load(dlg.FileName);
// set the image into the viewer
rasterImageViewer1.Image = srcFileName;
Leadtools.Codecs.CodecsThumbnailOptions ctoThumb = new CodecsThumbnailOptions();
if (srcFileName.Height > 150 || srcFileName.Width > 150)
if (srcFileName.Height >= srcFileName.Width)
ctoThumb.Height = 150;
ctoThumb.Width = 150;
ctoThumb.MaintainAspectRatio = false;
srcFileName = codecs.ReadThumbnail(dlg.FileName, ctoThumb, 1);

//Compression the Image(after resize)
codecs.Options.Jpeg2000.Save.TargetFileSize = 1100;
codecs.Options.Jpeg2000.Save.CompressionControl = CodecsJpeg2000CompressionControl.TargetSize;
codecs.Save(srcFileName, @"D:\jayaram\images\destfile\resizeImage.j2k", RasterImageFormat.J2k, srcFileName.BitsPerPixel);

please tel me answers for above all my questions

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, February 1, 2011 6:45:25 AM(UTC)

Adnan Ismail  

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

It's better to work on this issue step by step.
The first and most important step is to decide where you want all this to happen. Is it at the client side in a Windows application or is it in a browser-based application?

All this code below is part of our WinForms controls and Windows objects, and not a WebForms control. This means your options to use these functions are:
1. Either in a Windows Forms application.
2. Or in a webserver appliction where our DLLs are deployed on the server itself.
3. Or if you must use them in a browser-based application, you will need to deploy our DLLs with your own user control at the client side.
If you have other questions for support, please make sure to explain which of the above options you want to use.

About your questions, here are some details.
1- Resizing the image.
To resize the RasterImage you have two options:
a) Resize the image while loading it using the RasterCodecs.Load() overload that takes Image width and height values.
b) Call the ResizeCommand class to resize the image with new width and height values.
You do NOT need the ReadThumbnail() or the CodecsThumbnailOptions to resize your image.

2- Compress the Image.
To compress the file, you'll need to save it to the file format you need using the RasterCodecs.Save() method.

3- Uploading the image. The answer to this question depends on the server type. If the server accepts an HTML "PUT" method, such as FTP and SharePoint servers, you can use our RasterCodecs.Save() method overloads that take a Uri parameter.
#3 Posted : Monday, April 11, 2011 6:19:46 PM(UTC)


Groups: Registered
Posts: 3

[Spam post deleted by moderator]
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.

Powered by YAF.NET | YAF.NET © 2003-2021, Yet Another Forum.NET
This page was generated in 0.130 seconds.