ChingYen#8613
Hi,
I need a very fast way to know if an image is portrait or landscape or square.
My current version is loading the picture into size 80 thumbnail, and check on the orientation.
May I know is there any other better / faster way? It will be great if it don't even need to load the image.
I need a very fast way to know if an image is portrait or landscape or square.
My current version is loading the picture into size 80 thumbnail, and check on the orientation.
Dim thumbnail As New Aurigma.GraphicsMill.Bitmap
' Create appropriate format reader.
Dim reader As Aurigma.GraphicsMill.Codecs.FormatReader = _
Aurigma.GraphicsMill.Codecs.FormatManager.CreateFormatReader(FileName)
' LoadFrame returns a frame object.
' From this frame we can get a thumbnail.
Dim frame As Aurigma.GraphicsMill.Codecs.Frame = reader.LoadFrame(0)
frame.GetThumbnail(thumbnail, 80, 0)
frame.Dispose()
reader.Dispose()
If thumbnail.Width > thumbnail.Height Then
lLandscape = lLandscape + 1
ElseIf thumbnail.Height > thumbnail.Width Then
lPortrait = lPortrait + 1
Else
lSquare = lSquare + 1
End If
thumbnail.Dispose()
May I know is there any other better / faster way? It will be great if it don't even need to load the image.