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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, January 31, 2011 1:41:31 AM(UTC)
sivakrishna

Groups: Registered
Posts: 11


Hi,
I want to resize the original image with
150-width and 150-height.(using MaintainAspectRation property)
please send me sample program.
 

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 : Monday, January 31, 2011 3:57:34 AM(UTC)
sivakrishna

Groups: Registered
Posts: 11


hi,
I got a black image after i resize the image
how can i get original view of image?
 
#3 Posted : Monday, January 31, 2011 5:32:28 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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


Which LEADTOOLS Version are you using and what's you programming interface (.NET, API, CLIB, etc...)?

Also, what's the exact code you are using to achieve this? Please give me more details about this issue.
 
#4 Posted : Tuesday, February 1, 2011 8:02:33 PM(UTC)
sivakrishna

Groups: Registered
Posts: 11


hi,
I am using c#4.0,LeadTools v17.
I want to set the image sizes like
1.when image width or height is >150 and a)width>height then i want to change width=150 and height will be changed to lessthan width(150) using MaintainAspectRatio = false/true

b) height>width then height=150 and width will be changed to lessthan height(150) using MaintainAspectRatio = false/true
1.when image width and height both are <150 then i dont want to change my image width and height.




To resize the image you sent the following process,
by using your process I can not do my requirement.
I think you understand my problem.

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.


And when i set maintainaspectratio=true then i got an error is "invalid parameter".
please tel me answer for my problem...
 
#5 Posted : Wednesday, February 2, 2011 7:04:03 AM(UTC)

Basel  
Guest

Groups: Guests
Posts: 3,022

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

You originally opened a new thread for your answer, so our moderator merged it into this thread. In the future, if you want to reply to a post, please click the "Reply" button and not the "Post" button.

About the issue itself, here's how you can do it:
1- User RasterCodecs.GetInformation() to obtain original image width and height before loading it.
2- Do all your calculations (compare width, height, aspect ratio, etc.) to decide 2 numbers:
a) New loading width.
b) New loading height.
3- User RasterCodecs.Load(fileName, width, height, bitsPerPixel, RasterSizeFlags, CodecsLoadByteOrder) and give it the new width and new height.


Note that step 2 has many details (comparing width/height to each other and to 150), but since these are your requirements, you should be able to write all the code conditions. A hint about maintaining aspect ratio:
1. Determine NewWidth then calculate:
NewHeight = (OldHeight * NewWidth) / OldWidth
2. Or determine NewHeight then calculate:
NewWdith = (NewHeight * OldWidth) / OldHeight

 
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-2024, Yet Another Forum.NET
This page was generated in 0.078 seconds.