PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
WinBackgroundImage (Function)
In French: FenImageFond
Modifies the background image of a window and specifies the display mode of this image.
Versions 16 and later
WINDEVLinux This function is now available for the WINDEV applications in Linux.
New in version 16
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
Example
WINDEVReports and QueriesWindowsJavaUser code (UMC)
// Modify the background image of "WIN_EditImage"
// The new image is "C:\Documents\Bkgd.GIF"
// This image will be centered in the window
Res = WinBackgroundImage(WIN_EditImage, "C:\Documents\Bkgd.GIF", imgCentered)
Windows Mobile
// Modify the background image of "WIN_EditImage"
// The new image is "Documents\Bkgd.GIF"
// This image will be centered in the window
Res = WinBackgroundImage(WIN_EditImage, "\Documents\Bkgd.GIF", imgCentered)
Syntax
<Result> = WinBackgroundImage(<Window Name> , <Image Name> , <Display>)
<Result>: Boolean
  • True if the background image was modified,
  • False otherwise.
<Window Name>: Character string (with or without quotes)
Name of window to use.
If this parameter corresponds to an empty string (""), the current window is used.
<Image Name>: Character string
Name and full (or relative) path of the image to display in the window. A UNC path can be used. No image is displayed in the window if this parameter does not correspond to an existing image.
Windows Mobile No relative path or UNC path can be used.
<Display>: Constant
Indicates the display mode of the image:
imgNormal100%: Image displayed at 100% in the top left corner of the window.
imgCenteredCentered: Image centered in the window.
imgStretchedStretched: Image stretched across the entire surface of the window.
imgTiledTiled: Image displayed at 100% and tiled to occupy the entire surface of the control (tile).
imgHHomothetic: Image enlarged or reduced (by respecting the proportions of the initial image) to occupy the entire surface of the window.
imgHEHomothetic extended: Image enlarged or reduced (by respecting the proportions of the initial image) so that the smaller side of the image is entirely displayed in the window.
imgHCHomothetic centered: Image enlarged or reduced (by respecting the proportions of the initial image) and centered in the window.
imgHCEHomothetic centered extended: Image enlarged or reduced (by respecting the proportions of the initial image) so that the smaller side of the image is entirely displayed in the window and centered in the window.
imgHWISHomothetic without enlargement: If the image can be entirely displayed in the window, it is displayed at 100%. Otherwise, the image is proportionally reduced in order to be entirely displayed.
imgHCWISHomothetic centered without enlargement: If the image can be entirely displayed in the window, it is displayed at 100% and centered in the window. Otherwise, the image is proportionally reduced so that it can be entirely displayed and centered in the window.
Components
WINDEVReports and Queries wd230obj.dll
Windows Mobile wp230obj.dll
Java wd230java.jar
Linux wd230obj.so
Minimum required version
  • Version 9
This page is also available for…
Comments
ALTERANDO O PAPEL DE PAREDE DO SISTEMA
//OPEN JANELA GLOBAL
Alterar_Imagem()

//################################################

//JANELA MENU
PROCEDURE Alterar_Imagem()

PapelParede is string = INIRead("PAPEL_PAREDE","Imagem","",fCurrentDir()+"\PapelParede.ini")

Tipo is string = INIRead("PAPEL_PAREDE","Tipo","",fCurrentDir()+"\PapelParede.ini")

IF Tipo = 1
WinBackgroundImage(WIN_MENU , PapelParede , imgCentered )
ELSE IF Tipo = 2
WinBackgroundImage(WIN_MENU , PapelParede , imgTiled )
ELSE IF Tipo = 3
WinBackgroundImage(WIN_MENU , PapelParede , imgStretched )
ELSE
WinBackgroundImage(WIN_MENU , PapelParede , imgCentered )
END

//################################################

ADICIONE O EVENTO CLICK DIREITO DO MOUSE NA JANELA QUE ABRA O MENU POPUP NOVO COM ESSE EVENTO:

//Abre Alterar Papel Parede
ExecuteProcess(BTN_Papel_de_Parede,trtClick)

CRIE UM BOTAO NA POSICAO NEGATIVA COM ESSE CODIGO:

Open(WIN_PapelParede)

//################################################

CRIE UMA JANELA QUE LOCALIZE A IMAGEM E DEFINA A FORMA DE EXIBIÇÃO SE SERÁ CENTRALIZADA, LADO A LADO OU ESTICADA:

//LOCALIZE A IMAGEM

// Opens the file picker
EDT_IMAGEM = fSelect("", "", "Selecionar imagem para o Papel de Parede...", "*.jpg" + TAB + "*.jpg" + CR + "*.png" + TAB + "*.png" + CR + "*.bmp" + TAB + "*.bmp" + CR + "All the files (*.*)" + TAB + "*.*", "*.jpg")

IMG_PapelParede = EDT_IMAGEM

//################################################

//ALTERE A IMAGEM ATUAL POR UMA NOVA

//Alterar o Papel de Parede
ok is boolean
ok = INIWrite("PAPEL_PAREDE","Imagem",EDT_IMAGEM,fCurrentDir()+"\PapelParede.ini")
ok = INIWrite("PAPEL_PAREDE","Tipo",Tipo,fCurrentDir()+"\PapelParede.ini")
IF Tipo = 1
WinBackgroundImage(WIN_MENU , EDT_IMAGEM , imgCentered )
ELSE IF Tipo = 2
WinBackgroundImage(WIN_MENU , EDT_IMAGEM , imgTiled )
ELSE IF Tipo = 3
WinBackgroundImage(WIN_MENU , EDT_IMAGEM , imgStretched )
ELSE
WinBackgroundImage(WIN_MENU , EDT_IMAGEM , imgCentered )
END
IF ok = True THEN
ToastDisplay("Alterado papel de parede com sucesso!",toastShort,vaMiddle,haCenter)
END


//################################################

// REMOVENDO A CONFIGURAÇÃO

//Arquivo de Configuração
ok is boolean
ok = INIWrite("PAPEL_PAREDE","Imagem","",fCurrentDir()+"\PapelParede.ini")
ok = INIWrite("PAPEL_PAREDE","Tipo","",fCurrentDir()+"\PapelParede.ini")
WIN_MENU..BackgroundImage = ""
IF ok = True THEN
ToastDisplay("Alterado papel de parede com sucesso!",toastShort,vaMiddle,haCenter)
END

BONS ESTUDOS!
adrianoboller
Apr. 09 2016