TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: yarik on November 25, 2010, 04:47:18 PM
-
Hi Friends!
I need help please.
I search for a Visual lisp function to show a bitmap on screen like DOSLib (dos_splash), maybe through Windows API.
Thanks.
-
I found this example is not what I want but it works.
I hope someone can help
(defun gr_splash( filename imagetype xoff yoff xsize ysize time)
(if (not (member "acrender.arx" (arx)))
(arxload "acrender")
)
(c:replay filename imagetype xoff yoff xsize ysize)
(command "_delay" time)
(arxunload "acrender")
)
-
You can build a splash Screen with OpenDCL.
Though, if you won't accept Doslib you probably won't accept OpenDCL either.
-
Thank you Harry! :-)
I really appreciate your help.
DosLIB and OpenDCL are great solutions , but i need a function in open code.
Any idea?
Receives any suggestion
-
You can write an exe file with a timer (vb6, vb.net, etc...)
Than call it with lisp startapp subr
-
Ok, here is a solution, but you will have to figure out how to implement it within the contexts of VLisp. The solution requires two files, one is a specially formatted HTML file which contains the path to the image to be used for your splash screen, the second is a WScript shell that opens an IE window in full screen mode for a specified time and then closes it. You can use a timer or an event in your code to do the same thing.
The VBScript for the main part is:
Set oIE = CreateObject("InternetExplorer.Application")
Set oShell = CreateObject("WScript.Shell")
sTitle = "Splash Screen" ' used by AppActivate
'Path to your HTML Splash Screen
PathHTML = "C:\test.html"
With oIE
.FullScreen = True
.AddressBar = False
.ToolBar = False
.StatusBar = False
.Resizable = False
.Navigate(PathHTML)
Do Until .readyState = 4: wscript.sleep 100: Loop
With .document
With .ParentWindow
SWidth = .Screen.AvailWidth
SHeight = .Screen.AvailHeight
SWidthW = .Screen.AvailWidth * .5
SHeightW = .Screen.AvailHeight * .5
.resizeto SWidthW, SHeightW
.moveto (SWidth - SWidthW)/2, (SHeight - SHeightW)/2
End With
With .ParentWindow.document.body
.style.backgroundcolor = "LightBlue"
.scroll="no"
.style.Font = "12pt 'Arial'"
End With
.Title = sTitle
oIE.Visible = True
WScript.Sleep 100
oShell.AppActivate sTitle
End With ' document
End With ' oIE
wscript.sleep 5000
MsgIE("IE_Quit")
Sub MsgIE(sMsg)
On Error Resume Next ' Just in case the IE window is closed
If sMsg = "IE_Quit" Then
oIE.Quit
Else
oIE.Document.Body.InnerText = sMsg
oShell.AppActivate sTitle
End If
End Sub
HTML File
Make sure to put the fully qualified path to the image in the file.
<html>
<head>
<style type="text/css">
.centeredImage
{
text-align:center;
display:block;
width:50%;
height: 50%;
position: absolute; top: 25%; right: 25%;
}
</style>
</head>
<body>
<img src='path_to_your_image' class="centeredImage" />
</body>
</html>
If you don't want to utilize seperate files, you can try to update the inner HTML of the document yourself from code, but sometimes the images are not refreshed and don't display. You could create the HTML file on the fly with code, and that would make the code more portable.
-
Thank you Keith thats a good solution
Im trying to translate your code, if works correctly i posted here.
-
You could take a look at the following thread for some ideas of how to put images into dialog boxes:
http://www.theswamp.org/index.php?topic=34348.0