#1
Posted
:
Monday, June 13, 2016 5:59:04 AM(UTC)
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?
#2
Posted
:
Monday, June 13, 2016 9:16:21 AM(UTC)
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/chatRoberto Rodriguez
Developer Support Engineer
LEAD Technologies, Inc.
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.