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, June 13, 2016 6:04:04 AM(UTC)

bjack  
bjack

Groups: Registered, Tech Support
Posts: 10


I have an application using C# that loads images but I need a way to first check the height and width of the image and if it is over a certain height or width it will not display. How can I find the height and width without first displaying the image?
 

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, June 13, 2016 9:21:21 AM(UTC)

Roberto  
Roberto

Groups: Registered, Tech Support, Administrators
Posts: 39

Thanks: 2 times
Was thanked: 3 time(s) in 3 post(s)

Hello bjack,

You can use our RasterCodecs class to do this. The RasterCodecs class has a method GetInformation that will return image details from a file on disk. See here in our documentation: https://www.leadtools.co...tercodecs~getinformation(string,boolean).html

C# ex:
using (RasterCodecs codecs = new RasterCodecs())
{
var info = codecs.GetInformation(@"PATH TO YOUR FILE ON DISK", true);
Console.WriteLine("INFO Width: " + info.Width);
Console.WriteLine("INFO Height: " + info.Height);
}

If you haven't already you can download a free trial of our entire toolkit here: https://www.leadtools.com/downloads?category=main

Feel free to contact support via email at support@leadtools.com if you need one on one help getting started with our toolkit. You can also take advatange of our Live Chat support: https://www.leadtools.com/support/chat
Roberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
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-2020, Yet Another Forum.NET
This page was generated in 0.164 seconds.