FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Creating Bitmaps directly from Images on web
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Creating Bitmaps directly from Images on web
Posted: Fri Apr 15, 2016 02:24 AM
It is possible to create bitmaps from images on the web directly from URLs from FWH 16.04.

Sample program:
Code (fw): Select all Collapse
#include "fivewin.ch"

function Main()

   local oWnd, aBmp, oFont
   local cUrl  := "http://i.telegraph.co.uk/multimedia/archive/02722/taj-mahal-deal_2722393b.jpg"

   DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-16
   DEFINE WINDOW oWnd TITLE "BITMAPS LINKED TO URL"
   oWnd:SetFont( oFont )

   DEFINE BUTTONBAR oWnd:oBar OF ownd SIZE 64,80 2015
   oWnd:oBar:bPainted := { || oWnd:oBar:SayText( ;
      "All Images" + CRLF + "are directly" + CRLF + "from URL Links", ;
      { nil, nil, nil, -20 }, "R" ) }

   DEFINE BUTTON OF oWnd:oBar PROMPT "Aries" ;
      FILE "http://weknowyourdreamz.com/images/zodiac-01-aries-ram-icon.png"
   DEFINE BUTTON OF oWnd:oBar PROMPT "Taurus" ;
      FILE "http://weknowyourdreamz.com/images/zodiac-02-taurus-bull-icon.png"
   DEFINE BUTTON OF oWnd:oBar PROMPT "Leo" ;
      FILE "http://weknowyourdreamz.com/images/zodiac-05-leo-lion-icon.png"

   aBmp  := oWnd:ReadPalBmpEx( cUrl )
   oWnd:nHeight := 600
   oWnd:nWidth  := 700

   ACTIVATE WINDOW oWnd CENTERED ;
      ON PAINT oWnd:SayPalBmp( aBmp, { oWnd:oBar:nHeight,nil,nil,nil } )
   RELEASE FONT oFont
   PalBmpFree( aBmp )

return nil

EXTERNAL TURL,TIPCLIENTHTTP


Regards



G. N. Rao.

Hyderabad, India

Continue the discussion