News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

how to work with image component ?

Started by Abdel Hamid, January 29, 2019, 09:14:20 AM

Previous topic - Next topic

Abdel Hamid

Hello guys,
am trying to develop a simple application that changes the desktop wallpaper  :bgrin:
the only problem for me , how to use Image component ?
first step finished : using openfiledialog to load ("jpg files") ! (i used " Create File " to get the handle of the file opened as a first step)
second step not finished yet (loading the image to Image component) so the user can view the chosen image 
third step : Pressing the button to chage the wallpaper (finished) , i used SystemParametersInfo
now what are the functions used to deal with (Image) component ! am stuck at this stage  :(
PS : am working on both RadASM and WinAsm
thank you in advance  :t

ragdog

second step not finished yet (loading the image to Image component) so the user can view the chosen image 

The best way to preview the image, is use gdi or gdi++ and blit it to your dialog (bitblt)

Gdi++ or Gdi
http://www.masmforum.com/board/index.php?PHPSESSID=786dd40408172108b65a5a36b09c88c0&topic=18534.0

Abdel Hamid

Check the attachments to see what am trying to do !
i did this using VB.NET but i hate it ( need ASM code)

ragdog

What is your problem correctly?
Your video draw the image on dialog ok,
and set the wallpaper need you SystemParametersInfo correct.

SystemParametersInfo,SPI_SETDESKWALLPAPER, 0, chr$ ("C:\wallpaper.jpg"), SPIF_UPDATEINIFILE

mabdelouahab

It's easy.
Take the example attached and try it

Abdel Hamid

@ragdog  , thanks for your help
@mabdelouahab thank you so much , this is exactly what i wanted to do !  :greenclp:

mabdelouahab


Vortex

Hi mabdelouahab,

Thanks for your example. It's better than mine changing the wallpaper with COM.