SerenityNetworks
Board Regular
- Joined
- Aug 13, 2009
- Messages
- 131
- Office Version
- 365
- Platform
- Windows
I'm using several instances of the Private Function code below to display multiple images within an Excel form. It works fine. but I need to be able to adjust the brightness and contrast of the image displayed in each of the web containers. In the past, I've displayed images directly on a worksheet, then used the following code to change the contrast (and similarly for brightness). But I'm not figuring out how to do it for the images in the web containers. I could really use some help. (Note: I'm a hobbyist, not a coder. My VBA skills are limited.)
Thanks in advance,
Andrew
Thanks in advance,
Andrew
Code:
Sub SetContrast()
Dim shape As Excel.shape
Dim cnt As Long
cnt = 0
For Each shape In ActiveSheet.Shapes
If shape.Type = msoLinkedPicture Then
shape.PictureFormat.Contrast = gvarGlobalContrast
End If
Next shape
End Sub
Code:
Private Function fnCreateHTML1(strImgFilePath As String)
'//-----------------------------------------
'// Author : "Ivan F Moala"
'// Site : "http://www.xcelfiles.com"
'-------------------------------------------
Dim hdl As Long, m_Width1 As Long, m_Height1 As Long
Dim strAp1 As String
strAp1 = Chr(34)
m_Width1 = WebBrowser1.Width * HWF1 'WebBrowser1.Width * 1.325 is ratio of 96 / 72
m_Height1 = WebBrowser1.Height * HWF1
hdl = FreeFile
Open strPath & "Tmp1.html" For Output As [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL]
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , ""
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "<center>"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "******"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "Scroll = ""YES"""
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "LEFTMARGIN=0"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "TOPMARGIN=0"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , ""
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "[IMG]https://www.mrexcel.com/forum/ & strAp1 & picURL1 & strAp1 & _<br /> [/IMG] " height=" & m_Height1 & _
" border="0">"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , "</center>"
Print [URL="https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=hdl"]#hdl[/URL] , ""
Close hdl
End Function
Last edited: