Skip to content

Commit

Permalink
Update stdImage.cls - fix for undeclared "clipboard" (compile error) (#…
Browse files Browse the repository at this point in the history
…116)

* Update stdImage.cls - fix for undeclared "clipboard" compile error
  • Loading branch information
6DiegoDiego9 authored Jan 23, 2025
1 parent 82c1872 commit acf5507
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/stdImage.cls
Original file line number Diff line number Diff line change
Expand Up @@ -773,8 +773,10 @@ End Sub
'Copy the image to the clipboard
'@example `stdImage.CreateFromFile("H:\test1.bmp").ToClipboard()
Public Sub ToClipboard()
Dim oHtml As Object
Set oHtml = CreateObject("htmlfile")
if VarType(Clipboard) = vbObject then
Call Clipboard.SetData(ToStdPicture())
Call oHtml.parentWindow.clipboardData.SetData(ToStdPicture())
else
'Hack: This is a hack; better approach would be to get the image data as a byte array and use clipboard directly.
'TODO: A less hacky method can be found here: http://access.mvps.org/access/api/api0042.htm
Expand Down Expand Up @@ -967,4 +969,4 @@ End Function
Private Function BGR(ByVal longColor As Long) As Long
Call OleTranslateColor(longColor, 0, longColor)
BGR = RGB((longColor \ 65536) Mod 256, (longColor \ 256) Mod 256, (longColor Mod 256))
End Function
End Function

0 comments on commit acf5507

Please sign in to comment.