Author Topic: Splash bitmap like DOSLib  (Read 2985 times)

0 Members and 1 Guest are viewing this topic.

yarik

  • Newt
  • Posts: 32
Splash bitmap like DOSLib
« 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.
« Last Edit: November 25, 2010, 05:40:11 PM by yarik »

yarik

  • Newt
  • Posts: 32
Re: Splash bitmap like DOSLib
« Reply #1 on: November 25, 2010, 06:23:26 PM »
I found this example is not what I want but it works.
I hope someone can help
Code: [Select]
(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")
)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Splash bitmap like DOSLib
« Reply #2 on: November 25, 2010, 09:09:24 PM »

You can build a splash Screen with OpenDCL.

Though, if you won't accept Doslib you probably won't accept OpenDCL either.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

yarik

  • Newt
  • Posts: 32
Re: Splash bitmap like DOSLib
« Reply #3 on: November 26, 2010, 04:38:43 PM »
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

efernal

  • Bull Frog
  • Posts: 206
Re: Splash bitmap like DOSLib
« Reply #4 on: November 26, 2010, 08:30:07 PM »
You can write an exe file with a timer (vb6, vb.net, etc...)
Than call it with lisp startapp subr

e.fernal

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Splash bitmap like DOSLib
« Reply #5 on: November 27, 2010, 03:01:28 AM »
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:
Code: [Select]
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.
Code: [Select]
<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.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

yarik

  • Newt
  • Posts: 32
Re: Splash bitmap like DOSLib
« Reply #6 on: December 01, 2010, 12:47:21 PM »
Thank you Keith thats a good solution
Im trying to translate your code, if works correctly i posted here.

cmwade77

  • Swamp Rat
  • Posts: 1443
Re: Splash bitmap like DOSLib
« Reply #7 on: December 02, 2010, 11:38:40 AM »
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