Creating Bitmaps directly from Images on web

Creating Bitmaps directly from Images on web

Postby nageswaragunupudi » Fri Apr 15, 2016 2:24 am

It is possible to create bitmaps from images on the web directly from URLs from FWH 16.04.

Sample program:
Code: Select all  Expand view

#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
 


Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 72 guests