when I use the function
oImage1:= GDIBmp():new(,"hotdog" )
and move the WINDOW or size the WINDOW where I show the bitmap or I put another application window on the window where I show the bitmap
it erased the bitmap
#include "FiveWin.ch"
#include "constant.ch"
static oWnd,oBmp
Function Main()
DEFINE BITMAP oBmp FILENAME "C:\fwh\bitmaps\pngs\Logo.png"
DEFINE WINDOW oWnd FROM 10, 10 TO 48,110 TITLE "test"
DrawImage(oBmp)
ACTIVATE WINDOW oWnd ;
on init DrawImage(oWnd)
return nil
function DrawImage(ownd)
local hdc:= oWnd:getdc()
local oGraphics := Graphics():New( ownd:hDC )
local oImage:= GDIBmp():new(,"cuoco" )
oGraphics:DrawImage( oImage , 60 ,60 )
oGraphics:destroy()
oWnd:releasedc()
Return nil
nageswaragunupudi wrote:I do not want your sources. I do not have any use with them.
I pointed out the error in your sample and explained why your image is vanishing.
If you want to learn or not it is upto you.
#include "FiveWin.ch"
Static oWnd
Static oBmp
Static oImage
Function Main()
DEFINE WINDOW oWnd FROM 1, 1 TO 38,80 TITLE "Test"
DrawImage1()
DrawImage2()
ACTIVATE WINDOW oWnd ON PAINT ( DrawImage1(), DrawImage2() ) // ON INIT ( DrawImage1(), DrawImage2() )
oBmp:Destroy()
oImage:Destroy()
return nil
Function DrawImage1()
local hdc
local oGraphics
hdc := oWnd:GetDC()
oGraphics := Graphics():New( hDC )
if Empty( oBmp )
oBmp := GDIBmp():new("..\bitmaps\pngs\pan_setting.png" )
endif
oGraphics:DrawImage( oBmp , 10 ,10 )
oGraphics:Destroy()
oWnd:ReleaseDC()
Return nil
//----------------------------------------------------------------------------//
function DrawImage2()
local hdc
local oGraphics
hdc := oWnd:GetDC()
oGraphics := Graphics():New( hdc )
if Empty( oImage )
oImage:= GDIBmp():new("D:\fwh\fwhteam\bitmaps\sms.bmp" )
endif
oGraphics:DrawImage( oImage ,100 ,100 )
oGraphics:destroy()
oWnd:releasedc()
Return nil
//----------------------------------------------------------------------------//
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 110 guests