Create "Cover Flow" art on the fly
Posted: Thu Dec 20, 2007 10:40 pm
I came across a great Active X component from this site:
http://pagesperso-orange.fr/pierre.g/xn ... adgfl.html
Download the GLFAx v2.80, unzip, and register the dll in the win32->std folder. This dll is free for non-commercial use.
Using this component you can create coverflow art on the fly for any image. You can take an image such as the first cover pictured below and turn it into the second cover. Add a black background and you get the third image below , which is quite close in appearance to the cover flow images found in iTunes. This has the potential to add a bit of "eye candy" to images displayed on software remotes. You can't achieve the angled album appearance as in iTunes with this control; however, making images behind the center cover smaller by 50 px (constrained) and placing them in a stair-step fashion gives a similar feeling of depth to the image, fooling the eye into thinking the horizon lies beyond the images.
The following subroutine will allow you to make the bottom two images. Simply drop it into your script you are currently using to pull images and go:
Look for wide-spread use of this in my next theme.
Osler
EDIT: code updated to give improved output (see below)
http://pagesperso-orange.fr/pierre.g/xn ... adgfl.html
Download the GLFAx v2.80, unzip, and register the dll in the win32->std folder. This dll is free for non-commercial use.
Using this component you can create coverflow art on the fly for any image. You can take an image such as the first cover pictured below and turn it into the second cover. Add a black background and you get the third image below , which is quite close in appearance to the cover flow images found in iTunes. This has the potential to add a bit of "eye candy" to images displayed on software remotes. You can't achieve the angled album appearance as in iTunes with this control; however, making images behind the center cover smaller by 50 px (constrained) and placing them in a stair-step fashion gives a similar feeling of depth to the image, fooling the eye into thinking the horizon lies beyond the images.
The following subroutine will allow you to make the bottom two images. Simply drop it into your script you are currently using to pull images and go:
Code: Select all
MakeCFArt "C:", "Test.jpg", "CoverFlow.jpg", 300, 300, True
Private Sub MakeCFArt(ByVal strFolderPath, ByVal strInputFile, ByVal strOutputFile, ByVal lngFinalWidth, ByVal lngFinalHeight, ByVal blnBackground)
Dim LoadPath
Dim SavePath
Dim WidthOffset
Dim HeightOffset
Dim BackgroundWidth
Dim BackgroundHeight
Dim objImage
Set objImage = CreateObject("GflAx.GflAx")
LoadPath = strFolderPath & "\" & strInputFile
SavePath = strFolderPath & "\" & strOutputFile
WidthOffset = 800
HeightOffset = 100
BackgroundWidth = lngFinalWidth + WidthOffset
BackgroundHeight = (lngFinalHeight * 2) + HeightOffset
objImage.LoadBitmap(LoadPath)
objImage.Resize lngFinalWidth, lngFinalHeight
objImage.FlipVertical
objImage.GaussianBlur 2
objImage.lightness 30
objImage.Soften 50
objImage.SaveBitmap(strFolderPath & "\" & "ReflectedImage.jpg")
objImage.LoadBitmap(LoadPath)
objImage.Resize lngFinalWidth, lngFinalHeight
objImage.lightness 10
objImage.ResizeCanvas lngFinalWidth, (lngFinalHeight * 2), 0, vbBlack
objImage.SaveBitmap(strFolderPath & "\" & "ActualImage.jpg")
objImage.MergeAddFile strFolderPath & "\" & "ActualImage.jpg", 80, 0, 0
objImage.MergeAddFile strFolderPath & "\" & "ReflectedImage.jpg", 20, 0, lngFinalHeight
objImage.Merge
objImage.MergeClear
If blnBackground = True Then
objImage.ResizeCanvas BackgroundWidth, BackgroundHeight, 4, vbBlack
objImage.Crop 0, 0, BackgroundWidth, (BackgroundHeight - lngFinalHeight/2)
End If
objImage.SaveBitmap(SavePath)
Set objImage = Nothing
End Sub
Osler
EDIT: code updated to give improved output (see below)