Juatap - Un comunicador con letras llamativas tipo escaparat

y programas personales para otros como tu, puede que te corrijan ;)
Responder
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Juatap - Un comunicador con letras llamativas tipo escaparat

Mensaje por BasicOs »

Si estás con tu portatil en un lugar que no puedes hablar y quieres comunicarte con otra persona que está a distancia escribiendolo en un momento.
Muy bueno, se parece a las cintas con letras que se compran para poner en los escaparates
Para los jovenes, para los viejos, para los niños, para llamar la atención, para la biblioteca, para trabajar, para enviar una mensaje cifrado como ;x; ;) para un publico, o I LOVE YOU. o we go, nos vamos. Cierralo y nos vamos.......



Introducir dos datos al arrancarlo:
1.- el mensaje que deseas comunicar.
2.- el tamaño del mensaje (la resolución) que desees teniendo en cuenta el tamaño de la pantalla y la distancia del interlocutor.

Si alguien desea hacer algún cambio, como ponerlo residente en el tray, u otro, que lo publique por favor,
No ocupa lugar y el programa es de solo un fichero: juatap.exe
Salu22:)


Código: Seleccionar todo

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_icon=antiguo 3.3.6.1 antes del 8\oldApp\Icons\autoitEspanol.ico
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=BAsicos de autoit.es
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
; Juatap Anunciador en pantalla grande
; Créditos: Basicos de Autoit.es y eukalyptus de Autoit.de

#include <GDIPlus.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#include <GDIPlusConstants.au3>
#include <GUIConstantsEx.au3>
Opt("GUIOnEventMode", 1)

Global $iX = 0, $iW, $iStep = 8

_GDIPlus_Startup()

#Include <String.au3>

$vTamanoPantalla=StringSplit(InputBox("Configurando mensaje - Juatap","¿Que Tamaño quieres: anchoxalto? "& @CRLF&"Max:"&@DesktopWidth&"x"&@DesktopHeight,int(@DesktopWidth*0.95)&"x200"),"x")
if @error=1 then _Exit()

Global $hGui = GUICreate("Juatap", $vTamanoPantalla[1], $vTamanoPantalla[2])
GUISetBkColor(0x000000)
GUISetOnEvent(-3, "_Exit")
GUISetState()

$vMensaje=InputBox("Configurando mensaje - Juatap","¿Que mensaje quieres anunciar en el Letrero?","I love you - go ok?")
if @error=1 then _Exit()
$vMensaje=_StringRepeat("  "&$vMensaje, 4)

Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui)
Global $hBitmapBuffer = _GDIPlus_BitmapCreateFromGraphics($vTamanoPantalla[1], $vTamanoPantalla[2], $hGraphics)
Global $hGraphicsBuffer = _GDIPlus_ImageGetGraphicsContext($hBitmapBuffer)
_GDIPlus_GraphicsClear($hGraphicsBuffer, 0xFF000000)
Global $hBitmapLed = _CreateLedBitmap($hGraphics, $vMensaje, $vTamanoPantalla[1], $vTamanoPantalla[2], $iStep, $iStep, 0xFFFFBB00, 0x66111122)
;Global $hBitmapLed = _CreateLedBitmap($hGraphics, "Bienvenido a Autoit.es", 800, 200, $iStep, $iStep, 0xFF00FF00, 0x66000000)
$iW = @extended

GUIRegisterMsg($WM_PAINT, "_WM_PAINT")

While 1
    $iX -= $iStep
    If $iX + $iW < 0 Then $iX += $iW
    _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX, 0)
    _GDIPlus_GraphicsDrawImage($hGraphicsBuffer, $hBitmapLed, $iX + $iW, 0)
    _WinAPI_RedrawWindow($hGui, 0, 0, $RDW_INTERNALPAINT)
    Sleep(20)
WEnd

Func _WM_PAINT($hWnd, $Msg, $wParam, $lParam)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmapBuffer, 0, 0)
    Return $GUI_RUNDEFMSG
EndFunc   ;==>_WM_PAINT

Func _CreateLedBitmap($hGraphics, $sText, $iW, $iH, $iLedOffSet, $iLedSize, $iOnColor = 0xFFFFBB00, $iOffColor = 0x88111122, $sFont = "Arial")
    $sText = StringReplace($sText,@LF,"")
    Local $hBrush = _GDIPlus_BrushCreateSolid($iOnColor)
    Local $hBrushOff = _GDIPlus_BrushCreateSolid($iOffColor)
    Local $hFormat = _GDIPlus_StringFormatCreate()
    Local $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    Local $hFont = _GDIPlus_FontCreate($hFamily, $iH, 1, 2)
    Local $tLayout = _GDIPlus_RectFCreate($iW, 0, 0, 0)
    Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sText, $hFont, $tLayout, $hFormat)
    Local $iWidth = Ceiling(DllStructGetData($aInfo[0], "Width")) + $iW
    $iWidth -= Mod($iWidth, $iLedOffSet)
    Local $iHeight = Ceiling(DllStructGetData($aInfo[0], "Height"))
    DllStructSetData($aInfo[0], "Y", -Round(($iHeight - $iH) / 3))
    Local $hBitmapTxt = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hBitmapLed = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics)
    Local $hGraphicsTxt = _GDIPlus_ImageGetGraphicsContext($hBitmapTxt)
    Local $hGraphicsLed = _GDIPlus_ImageGetGraphicsContext($hBitmapLed)
    _GDIPlus_GraphicsClear($hGraphicsTxt, $iOffColor)
    _GDIPlus_GraphicsDrawStringEx($hGraphicsTxt, $sText, $hFont, $aInfo[0], $hFormat, $hBrush)
    Local $BitmapData = _GDIPlus_BitmapLockBits($hBitmapTxt, 0, 0, $iWidth, $iHeight, $GDIP_ILMREAD, $GDIP_PXF32ARGB)
    Local $Stride = DllStructGetData($BitmapData, "Stride")
    Local $Width = DllStructGetData($BitmapData, "Width")
    Local $Height = DllStructGetData($BitmapData, "Height")
    Local $Scan0 = DllStructGetData($BitmapData, "Scan0")
    Local $PixelData, $Color = Hex($iOnColor)
    For $row = 0 To $Height - 1 Step $iLedOffSet
        For $col = 0 To $Width - 1 Step $iLedOffSet
            $PixelData = DllStructCreate("dword", $Scan0 + ($row * $Stride) + ($col * 4))
            If Hex(DllStructGetData($PixelData, 1)) = $Color Then
                _GDIPlus_GraphicsFillEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hBrush)
            Else
                _GDIPlus_GraphicsFillEllipse($hGraphicsLed, $col, $row, $iLedSize, $iLedSize, $hBrushOff)
            EndIf
        Next
    Next
    _GDIPlus_BitmapUnlockBits($hBitmapTxt, $BitmapData)
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_BrushDispose($hBrushOff)
    _GDIPlus_BitmapDispose($hBitmapTxt)
    _GDIPlus_GraphicsDispose($hGraphicsTxt)
    _GDIPlus_GraphicsDispose($hGraphicsLed)
    Return SetExtended($iWidth, $hBitmapLed)
EndFunc   ;==>_CreateLedBitmap

Func _Exit()
    _GDIPlus_BitmapDispose($hBitmapLed)
    _GDIPlus_GraphicsDispose($hGraphicsBuffer)
    _GDIPlus_BitmapDispose($hBitmapBuffer)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
EndFunc   ;==>_Exit
Adjuntos
Juatap.zip
Ejecutable Juatap.exe y fuentes Juatap.au3 - 350kb
(397.72 KiB) Descargado 164 veces
juatap.jpg
juatap.jpg (81.52 KiB) Visto 1969 veces
Avatar de Usuario
Chefito
Profesional del Autoit
Mensajes: 2035
Registrado: 21 Feb 2008, 18:42
Ubicación: Albacete/Cuenca (España)

Re: Un anunciador con letras luminosas de escaparate

Mensaje por Chefito »

Jejejeje....muy chulos los 3 scripts :smt023 .
Este efecto esta muy bien. A mi me va a tocar pelearme con el gdi para hacer una cosa que quiero :smt024 .
A ver lo si lo consigo.

Saludos.
Cita vista en algún lugar de la red: En este mundo hay 10 tipos de personas, los que saben binario y los que no ;).
Avatar de Usuario
EuroHack
Mensajes: 13
Registrado: 30 Dic 2011, 17:09

Re: Un anunciador con letras luminosas de escaparate

Mensaje por EuroHack »

no salen las letras.
Avatar de Usuario
BasicOs
Site Admin
Mensajes: 2085
Registrado: 21 Nov 2006, 19:24
Ubicación: El Internet - (Canarias, España)
Contactar:

Re: Juatap - Un anunciador con letras luminosas de escaparat

Mensaje por BasicOs »

CAMBIOS EN EL PRIMER POS, INCLUYE EJECUTABLE.

Introducir el mensaje Y EL tamaño deseado cada vez. :smt023 :smt023

Ahora tienes el ejecutable también en el zip de descarga. Funciona de maravilla, m

Muchos mensajes de Amor con el Juatap, a ver si cambia el mundo ;) :smt034 :smt034 :smt034 :smt034

Salu22:)
Responder