From Web to image control
Moderator: Rathinagiri
From Web to image control
Hello my friends !
How download a image from a website and put it automatically into a image control ?
The name of the image I find is what I need.
Niko
How download a image from a website and put it automatically into a image control ?
The name of the image I find is what I need.
Niko
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: From Web to image control
Niko, Can you please explain more details/example about what you want?
Serge
Serge
There's nothing you can do that can't be done...
Re: From Web to image control
Hello Niko,
It is possible with HMG Extended in the following easy way
Please take a look for a working sample below:Win_1.Image_1.Picture := cUrl
Code: Select all
/*
* MINIGUI - Harbour Win32 GUI library Demo
* (c) 2017 Grigory Filatov <gfilatov@inbox.ru>
*/
#include <hmg.ch>
FUNCTION Main
local cURL1 := "https://upload.wikimedia.org/wikipedia/commons/c/c8/Taj_Mahal_in_March_2004.jpg"
local cURL2 := "http://cdn.history.com/sites/2/2015/04/hith-eiffel-tower-iStock_000016468972Large.jpg"
define window win_1 ;
main ;
clientarea 800, 633 ;
title "JPEG Image From URL" ;
backcolor { 204, 220, 240 } nosize
on key escape action win_1.release()
DEFINE TOOLBAR ToolBar_1 BUTTONSIZE 100,16 FLAT
BUTTON Button_1 ;
CAPTION 'EiffelTower' ;
ACTION ( Win_1.Image_1.Picture := cUrl2 ) ;
TOOLTIP 'Load Eiffel Tower background'
BUTTON Button_2 ;
CAPTION 'TajMahal' ;
ACTION ( Win_1.Image_1.Picture := cUrl1 ) ;
TOOLTIP 'Load Taj Mahal background'
END TOOLBAR
define image image_1
row 33
col 0
width 800
height 600
picture cURL2
stretch .T.
end image
end window
win_1.minbutton := .F.
win_1.maxbutton := .F.
win_1.center
win_1.activate
RETURN NIL
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Re: From Web to image control
Thanks Serge, Grigory
My English is very poor... but I will try to explain better what I would like:
1. In my program I create a url where the image name is the variable part of this url.
2. Through hyperlink control I do search on the web
3. When I choose between the many images, that interest me and which I will
appears in my image control (as Grigorys example (thank you !)).
4. I'm going through my program by tapping save image as: to save it
in a folder on the disc with a new image name.
is this possible?
Niko
My English is very poor... but I will try to explain better what I would like:
1. In my program I create a url where the image name is the variable part of this url.
2. Through hyperlink control I do search on the web
3. When I choose between the many images, that interest me and which I will
appears in my image control (as Grigorys example (thank you !)).
4. I'm going through my program by tapping save image as: to save it
in a folder on the disc with a new image name.
is this possible?
Niko
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
Re: From Web to image control
This is an example in HMG:
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: From Web to image control
Great ! Thanks a lot, it could be very usefull !
Serge
Serge
There's nothing you can do that can't be done...
Re: From Web to image control
Thanks a lot my friend! I'll try it right away!
Niko
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: From Web to image control
Wonderful KDJ!
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: From Web to image control
Wonderful !!!
Thanks Krzysztof!
Thanks Krzysztof!
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64