ANBSThumbImg + ANBSThumbLink

Creates thumb of an image with or without link to original
Use ANBSThumbLink to create thumb and link to original image
Use ANBSThumbImg to create thumb without link
Uses Thumbnail3.aspx and fancybox for larger image (both attached)
Latest fancybox3 can be found here.
Thumbnail3.aspx was found online, and then enhanced to meet my needs.

Edit 2023-05-23: Added thumbnail4.aspx which has ability to save image into server with postfix to filename (added parameter save2). please check http://aspnot.net/A/Thumbnail for more details.

Set1 /?Devid=UZ02TYA98O
Set3 /?DevID=ULV2F50NVJ

CodeFunctionName
What is this?

Public

Tested

Original Work
Function ANBSThumbLink(Img, ToWidth, ImgClasses)
    ' Creats a link to enlarge image
    '    That image is actually resized using thumbnail3.aspx
    'Needs: ANBSThumbImg and FancyBox
    ' <a href="""" > <img src="/Assets/thumbnail3.aspx?h=200&f=Dir_Img/AlwahOld.jpg" class="img-thumbnail" / > </a >
    FancyBox                    = ""
    If ToWidth = "" Then ToWidth = "200"
    Rett                        = ""
    Rett                        = Rett & " <a href=""" & Img & """ data-fancybox=""fancybox"" "
    Rett                        = Rett & " >"
    Rett                        = Rett & ANBSThumbImg(Img, ToWidth, ImgClasses)
    Rett                        = Rett & " </a >"
    Rett                        = Rett & ""
    ANBSThumbLink            = Rett
End Function
Function ANBSThumbImg(Img, ToWidth, ImgClasses)
    '    That image is actually resized using thumbnail3.aspx
    'Needs: ThumbASPX
    ' <img src="/Assets/thumbnail3.aspx?h=200&f=Dir_Img/AlwahOld.jpg" class="img-thumbnail" / >
    ThumbASPX                = Dir_Thumbnail3aspx ' full path and file for thumbnail3.aspx
    Rett                        = ""
    Rett                        = Rett & " <img src=""" & ThumbASPX & "?h=" & ToWidth & "&f=" & Img & """ class=""" & ImgClasses & """ "
    Rett                        = Rett & "/ >"
    ANBSThumbImg            = Rett
End Function

Img, ToWidth, ImgClasses

To create an image with click to enlarge
Call ANBSThumbLink("myimage.png", 200, "img-thumbnail")

To create an image only with no click
ANBSThumbImg("OurImg.jpg", 10, "")

Views 2,292

Downloads 540

CodeID
DB ID