Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #8417 > unrolled thread

Icon draw question

Started byFabio Romling Rotheia <pinbitmap@gmail.com>
First post2015-09-18 18:03 -0700
Last post2015-10-19 16:20 -0700
Articles 13 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-09-18 18:03 -0700
    Re: Icon draw question Franz Rachbauer <office@rachbauer.org> - 2015-09-19 08:26 +0200
      Re: Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-09-19 05:54 -0700
        Re: Icon draw question "Karl-Heinz" <invalid@invalid.invalid> - 2015-09-19 18:25 +0200
          Re: Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-09-19 13:57 -0700
            Re: Icon draw question Franz Rachbauer <office@rachbauer.org> - 2015-09-22 08:13 +0200
            Re: Icon draw question Karl Wochele <kw@e©os-system.dot.de> - 2015-09-22 13:15 +0200
            Re: Icon draw question "Karl-Heinz" <invalid@invalid.invalid> - 2015-09-22 21:04 +0200
    Re: Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-09-22 12:57 -0700
    Re: Icon draw question Paulo Oliveira <paulo@clipinfor.com> - 2015-10-08 09:45 -0700
      Re: Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-10-12 21:50 -0700
        Re: Icon draw question Paulo Oliveira <paulo@clipinfor.com> - 2015-10-19 08:51 -0700
          Re: Icon draw question Fabio Romling Rotheia <pinbitmap@gmail.com> - 2015-10-19 16:20 -0700

#8417 — Icon draw question

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-09-18 18:03 -0700
SubjectIcon draw question
Message-ID<d5121a48-5b41-45c0-96e5-0892c946c7db@googlegroups.com>
Hello there!

I'm drawing some icons on my shellwindow using this:

oIcon := My_Icon1{}
DrawIconEx( hDC, 150, 200, oIcon:Handle(), oIcon:size:width, oIcon:size:height, 0, 0, DI_NORMAL)
I'm also using 	"CASE uMsg==WM_MOUSEMOVE" to change the pointer to a hand and
"CASE uMsg==WM_LBUTTONDOWN .or. uMsg==WM_LBUTTONUP" to click on it and call a datawindow.

Everything is fine, but now I want to draw another icon on the same place, when the user position the mouse on top of it, and redraw the first icon when the mouse is not on top of it. All this to appear that the icon is moving (it's a cashier and one icon has paper coming out).

The problem is that inside the MdiClientWinProc function, where this is all happening, I can't call a repaint to force this part of the screen to draw the icons.

Anyone out there, specially old VOers, known how to do it?


Thanks in advance,

Fábio Romling Rotheia.

[toc] | [next] | [standalone]


#8418

FromFranz Rachbauer <office@rachbauer.org>
Date2015-09-19 08:26 +0200
Message-ID<mtiv7d$hf6$1@speranza.aioe.org>
In reply to#8417
Hi Fabio,

Am 19.09.2015 um 03:03 schrieb Fabio Romling Rotheia:
> Everything is fine, but now I want to draw another icon on the same place,
  when the user position the mouse on top of it, and redraw the first 
icon when
  the mouse is not on top of it. All this to appear that the icon is moving
  (it's a cashier and one icon has paper coming out).

what about drawing 2 icons on the same place and show/hide it depending 
on mouse position?

Regards, Franz

[toc] | [prev] | [next] | [standalone]


#8419

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-09-19 05:54 -0700
Message-ID<e69556bc-fd87-4c15-a46d-b0662e4048ef@googlegroups.com>
In reply to#8418
Hi Franz,

Since i'm using DrawIconEx() to draw the icons on the shellwindow and they are not controls, how can i hide and show them? 

I managed to get it working with this:

SetRect( @rc, 150, 200, 280, 315 )
InvalidateRect( hWnd, @rc, true )
liRetVal := CallWindowProc(  lpfnDefaultProc , hWnd, uMsg, wParam, lParam )				
but the square part of the screen where they are is flickering a lot when the mouse is over.

Best regards,
Fábio.


Em sábado, 19 de setembro de 2015 03:26:56 UTC-3, Franz Rachbauer  escreveu:
> Hi Fabio,
> 
> Am 19.09.2015 um 03:03 schrieb Fabio Romling Rotheia:
> > Everything is fine, but now I want to draw another icon on the same place,
>   when the user position the mouse on top of it, and redraw the first 
> icon when
>   the mouse is not on top of it. All this to appear that the icon is moving
>   (it's a cashier and one icon has paper coming out).
> 
> what about drawing 2 icons on the same place and show/hide it depending 
> on mouse position?
> 
> Regards, Franz

[toc] | [prev] | [next] | [standalone]


#8420

From"Karl-Heinz" <invalid@invalid.invalid>
Date2015-09-19 18:25 +0200
Message-ID<d65gkuFp69cU1@mid.individual.net>
In reply to#8419
Hi Fabio,

>> Since i'm using DrawIconEx() to draw the icons on the
>> shellwindow and they are not controls, how can i hide and show them?


try a FixedIcon Control:


1. Create the control dynamically in your ShellWindow show() - after
super:show()

   e.g.

   _oFixedIcon := FixedIcon { SELF:handle( 4 )  , 4711 , Point { 20 ,20 }}
   _oFixedIcon:Size := Dimension { 16 , 16 }

   _oFixedIcon:SetIcon ( _oRedIcon  )  // initial  icon
   _oFixedIcon:Show()


2. _oFixedIcon, _oRedIcon and _oGreenIcon are protect vars of your  shell
window.

   protect _oFixedIcon as FixedIcon
   protect _oRedIcon as Icon
   protect _oGreenIcon as Icon


3. create the required icons inside the Shellwindow Init()

   e.g.

   _oRedIcon := Icon {ResourceID{"icoLEDRed",_GetInst()}, LR_DEFAULTCOLOR ,
16,16 }
   _oGreenIcon := Icon {ResourceID{"icoLEDGreen",_GetInst()},
LR_DEFAULTCOLOR , 16,16 }



4. Inside the MdiClientProc you have always access to the shellwindow object

   e.g.

   case uMsg == WM_MOUSEMOVE

        oShellWin := GetObjectByHandle ( GetParent ( hWnd ) )

    Forward the required messages either to your shellwindow or switch the
icons within  the MdiClientProc.

    e.g.

    if ismethod ( oShellWin , #SwitchIcon )
        send ( oShellWin , #SwitchIcon , #Green )  // or #RED
    endif


     method SwitchIcon ( symIcon ) class YourShellWindow

    do case
    case symIcon == #Green

       _oFixedIcon:SetIcon ( _oGreenIcon  )

    case symIcon == #Red

       _oFixedIcon:SetIcon ( _oRedIcon  )

    endcase


In Germany we would say: "i hope you can follow me"  ;-)

regards
Karl-Heinz 

[toc] | [prev] | [next] | [standalone]


#8421

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-09-19 13:57 -0700
Message-ID<6fb6b4eb-0d75-489d-8015-cad5be58accd@googlegroups.com>
In reply to#8420
Hey Franz and Karl,

You guys are Genius!
It Works!!

Another question: The icon is not transparent, like when i draw with DrayIconEx. Is there a way to make it transparent?

Thanks a lot!
Fábio.

Em sábado, 19 de setembro de 2015 13:26:08 UTC-3, Karl-Heinz  escreveu:
> Hi Fabio,
> 
> >> Since i'm using DrawIconEx() to draw the icons on the
> >> shellwindow and they are not controls, how can i hide and show them?
> 
> 
> try a FixedIcon Control:
> 
> 
> 1. Create the control dynamically in your ShellWindow show() - after
> super:show()
> 
>    e.g.
> 
>    _oFixedIcon := FixedIcon { SELF:handle( 4 )  , 4711 , Point { 20 ,20 }}
>    _oFixedIcon:Size := Dimension { 16 , 16 }
> 
>    _oFixedIcon:SetIcon ( _oRedIcon  )  // initial  icon
>    _oFixedIcon:Show()
> 
> 
> 2. _oFixedIcon, _oRedIcon and _oGreenIcon are protect vars of your  shell
> window.
> 
>    protect _oFixedIcon as FixedIcon
>    protect _oRedIcon as Icon
>    protect _oGreenIcon as Icon
> 
> 
> 3. create the required icons inside the Shellwindow Init()
> 
>    e.g.
> 
>    _oRedIcon := Icon {ResourceID{"icoLEDRed",_GetInst()}, LR_DEFAULTCOLOR ,
> 16,16 }
>    _oGreenIcon := Icon {ResourceID{"icoLEDGreen",_GetInst()},
> LR_DEFAULTCOLOR , 16,16 }
> 
> 
> 
> 4. Inside the MdiClientProc you have always access to the shellwindow object
> 
>    e.g.
> 
>    case uMsg == WM_MOUSEMOVE
> 
>         oShellWin := GetObjectByHandle ( GetParent ( hWnd ) )
> 
>     Forward the required messages either to your shellwindow or switch the
> icons within  the MdiClientProc.
> 
>     e.g.
> 
>     if ismethod ( oShellWin , #SwitchIcon )
>         send ( oShellWin , #SwitchIcon , #Green )  // or #RED
>     endif
> 
> 
>      method SwitchIcon ( symIcon ) class YourShellWindow
> 
>     do case
>     case symIcon == #Green
> 
>        _oFixedIcon:SetIcon ( _oGreenIcon  )
> 
>     case symIcon == #Red
> 
>        _oFixedIcon:SetIcon ( _oRedIcon  )
> 
>     endcase
> 
> 
> In Germany we would say: "i hope you can follow me"  ;-)
> 
> regards
> Karl-Heinz

[toc] | [prev] | [next] | [standalone]


#8422

FromFranz Rachbauer <office@rachbauer.org>
Date2015-09-22 08:13 +0200
Message-ID<mtqri6$udf$3@speranza.aioe.org>
In reply to#8421
Hi Fabio,
I think transparent style is not applicable to FixedIcon, see:
http://compgroups.net/comp.clipper.visual-objects/transparent-fixedicon/2839020

Regards, Franz

[toc] | [prev] | [next] | [standalone]


#8423

FromKarl Wochele <kw@e©os-system.dot.de>
Date2015-09-22 13:15 +0200
Message-ID<d6crkbFjarbU1@mid.individual.net>
In reply to#8421
Hi Fabio,

you might try to use the background of your shellwindow as the 
background of your fixedicon, e. g.

class MyFixedIcon inherit FixedIcon

METHOD Expose(oEvent) CLASS MyFixedIcon

SELF:Background	:= Brush{<Color of the background of your shellwindow>}
SUPER:Expose(oEvent)

RETURN SELF

HTH
Karl


Am 19.09.2015 um 22:57 schrieb Fabio Romling Rotheia:
> Hey Franz and Karl,
>
> You guys are Genius!
> It Works!!
>
> Another question: The icon is not transparent, like when i draw with DrayIconEx. Is there a way to make it transparent?
>
> Thanks a lot!
> Fábio.
>
> Em sábado, 19 de setembro de 2015 13:26:08 UTC-3, Karl-Heinz  escreveu:
>> Hi Fabio,
>>
>>>> Since i'm using DrawIconEx() to draw the icons on the
>>>> shellwindow and they are not controls, how can i hide and show them?
>>
>>
>> try a FixedIcon Control:
>>
>>
>> 1. Create the control dynamically in your ShellWindow show() - after
>> super:show()
>>
>>     e.g.
>>
>>     _oFixedIcon := FixedIcon { SELF:handle( 4 )  , 4711 , Point { 20 ,20 }}
>>     _oFixedIcon:Size := Dimension { 16 , 16 }
>>
>>     _oFixedIcon:SetIcon ( _oRedIcon  )  // initial  icon
>>     _oFixedIcon:Show()
>>
>>
>> 2. _oFixedIcon, _oRedIcon and _oGreenIcon are protect vars of your  shell
>> window.
>>
>>     protect _oFixedIcon as FixedIcon
>>     protect _oRedIcon as Icon
>>     protect _oGreenIcon as Icon
>>
>>
>> 3. create the required icons inside the Shellwindow Init()
>>
>>     e.g.
>>
>>     _oRedIcon := Icon {ResourceID{"icoLEDRed",_GetInst()}, LR_DEFAULTCOLOR ,
>> 16,16 }
>>     _oGreenIcon := Icon {ResourceID{"icoLEDGreen",_GetInst()},
>> LR_DEFAULTCOLOR , 16,16 }
>>
>>
>>
>> 4. Inside the MdiClientProc you have always access to the shellwindow object
>>
>>     e.g.
>>
>>     case uMsg == WM_MOUSEMOVE
>>
>>          oShellWin := GetObjectByHandle ( GetParent ( hWnd ) )
>>
>>      Forward the required messages either to your shellwindow or switch the
>> icons within  the MdiClientProc.
>>
>>      e.g.
>>
>>      if ismethod ( oShellWin , #SwitchIcon )
>>          send ( oShellWin , #SwitchIcon , #Green )  // or #RED
>>      endif
>>
>>
>>       method SwitchIcon ( symIcon ) class YourShellWindow
>>
>>      do case
>>      case symIcon == #Green
>>
>>         _oFixedIcon:SetIcon ( _oGreenIcon  )
>>
>>      case symIcon == #Red
>>
>>         _oFixedIcon:SetIcon ( _oRedIcon  )
>>
>>      endcase
>>
>>
>> In Germany we would say: "i hope you can follow me"  ;-)
>>
>> regards
>> Karl-Heinz
>

[toc] | [prev] | [next] | [standalone]


#8424

From"Karl-Heinz" <invalid@invalid.invalid>
Date2015-09-22 21:04 +0200
Message-ID<d6dnb9Fqd05U1@mid.individual.net>
In reply to#8421
Hi Fabio,

>> Another question: The icon is not transparent, like when i draw with
>> DrayIconEx.
>> Is there a way to make it transparent?

GetSysColor ( COLOR_APPWORKSPACE ) gives you the background color of the 
shellwindow. The default result is equal to the rgb values 171,171,171.


1. When you create the control in this way:

NOTE:  instead of self:handle ( 4 )  i´m using self:handle()  and assign a
background brush to the control.


_oFixedIcon := FixedIcon { SELF:handle( ) , 4711 , Point { 20 ,20 }}
_oFixedIcon:Size := Dimension { 16 , 16 }

_oFixedIcon:Background := Brush { Color { 171,171,171 } }

_oFixedIcon:SetIcon ( _oRedIcon  )  // initial  icon
_oFixedIcon:Show()

your  current icons should be shown transparent, but self:handle() is the
wrong handle -  when you resize the shell you can see what happens to the
icons.


2. So - IMO - the only way is to stay with handle(4) and change the
transparent color of your icons to GetSysColor ( COLOR_APPWORKSPACE )


regards
Karl-Heinz 

[toc] | [prev] | [next] | [standalone]


#8425

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-09-22 12:57 -0700
Message-ID<9d1cbe74-e138-44e4-b272-769710bb021e@googlegroups.com>
In reply to#8417
Hello Karl/Franz!

The problem is that i have a bitmap loaded in the background of my shellwindow, with lots of pictures and information on it. That's why i needed the icon to be transparent, like when i use the function Drawiconex.

I think i'll have to use DrawIconEx and find a way to minimize the flickering.

Thanks anyway!

Best regards,
Fábio.

Em sexta-feira, 18 de setembro de 2015 22:03:50 UTC-3, Fabio Romling Rotheia  escreveu:
> Hello there!
> 
> I'm drawing some icons on my shellwindow using this:
> 
> oIcon := My_Icon1{}
> DrawIconEx( hDC, 150, 200, oIcon:Handle(), oIcon:size:width, oIcon:size:height, 0, 0, DI_NORMAL)
> I'm also using 	"CASE uMsg==WM_MOUSEMOVE" to change the pointer to a hand and
> "CASE uMsg==WM_LBUTTONDOWN .or. uMsg==WM_LBUTTONUP" to click on it and call a datawindow.
> 
> Everything is fine, but now I want to draw another icon on the same place, when the user position the mouse on top of it, and redraw the first icon when the mouse is not on top of it. All this to appear that the icon is moving (it's a cashier and one icon has paper coming out).
> 
> The problem is that inside the MdiClientWinProc function, where this is all happening, I can't call a repaint to force this part of the screen to draw the icons.
> 
> Anyone out there, specially old VOers, known how to do it?
> 
> 
> Thanks in advance,
> 
> Fábio Romling Rotheia.

[toc] | [prev] | [next] | [standalone]


#8503

FromPaulo Oliveira <paulo@clipinfor.com>
Date2015-10-08 09:45 -0700
Message-ID<40dcf432-2d7d-476a-a5b4-21d7d57d27d7@googlegroups.com>
In reply to#8417
sábado, 19 de Setembro de 2015 às 02:03:50 UTC+1, Fabio Romling Rotheia escreveu:
> Hello there!
> 
> I'm drawing some icons on my shellwindow using this:
> 
> oIcon := My_Icon1{}
> DrawIconEx( hDC, 150, 200, oIcon:Handle(), oIcon:size:width, oIcon:size:height, 0, 0, DI_NORMAL)
> I'm also using 	"CASE uMsg==WM_MOUSEMOVE" to change the pointer to a hand and
> "CASE uMsg==WM_LBUTTONDOWN .or. uMsg==WM_LBUTTONUP" to click on it and call a datawindow.
> 
> Everything is fine, but now I want to draw another icon on the same place, when the user position the mouse on top of it, and redraw the first icon when the mouse is not on top of it. All this to appear that the icon is moving (it's a cashier and one icon has paper coming out).
> 
> The problem is that inside the MdiClientWinProc function, where this is all happening, I can't call a repaint to force this part of the screen to draw the icons.
> 
> Anyone out there, specially old VOers, known how to do it?
> 
> 
> Thanks in advance,
> 
> Fábio Romling Rotheia.

Hi all,

I need some samples to put icons and images in gShellWindow (Graphics4VO).
Some help.

TIA
Paulo Oliveira

[toc] | [prev] | [next] | [standalone]


#8510

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-10-12 21:50 -0700
Message-ID<0823c74d-833c-48bb-979d-cb0c8b2faf31@googlegroups.com>
In reply to#8503
Hello Paulo!

I can send you some code on how to load icons on the shellwindow using the API function DrawIconEX, but I don't use Graphics4VO.

Best regards,
Fábio.

[toc] | [prev] | [next] | [standalone]


#8536

FromPaulo Oliveira <paulo@clipinfor.com>
Date2015-10-19 08:51 -0700
Message-ID<d0c8ccd7-06dd-47be-a638-6a2cd809fc91@googlegroups.com>
In reply to#8510
Hi Fábio,

Please send me some samples.

Thanks

Paulo

[toc] | [prev] | [next] | [standalone]


#8537

FromFabio Romling Rotheia <pinbitmap@gmail.com>
Date2015-10-19 16:20 -0700
Message-ID<4e2841ef-be4d-413f-8647-b06767204cd2@googlegroups.com>
In reply to#8536
Hi Paulo,

Here is the code to draw a bitmap and an icon on the shellwindow.

Most of it i got on V.O.'s support sites, except for the icon part. If you have any questions, fell free to ask.


// put this in your init method of the shell Window
	self:ShellWithCentredBitMap("Text here")	

METHOD ShellWithCentredBitMap(cText as string) CLASS MyShellWindow
	LOCAL hWnd as ptr
	hWnd := self:Handle(4)
	
	// Set up the replacement WndProc for the shell
	SubClassWindow(  hWnd, @MdiClientWinProc() )

	// Load our bitmap
	self:hBkGndBitMap := LoadImage( null_ptr, Cast2Psz("C:\BMPS\Main_Screen_1920x1080.BMP"), IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE)

	// Send the following message to set up the MdiClientWndProc
	SendMessage( hWnd, WM_USER + 4, 0, LONG( _cast, self:hBkGndBitMap ) )
	InvalidateRect( hWnd, null_ptr, true )
RETURN( self 
Function MdiClientWinProc( hWnd as ptr, uMsg as DWord, wParam as DWord, lParam as Long ) as Long _Wincall	
	// Replacement WinProc for the Shell
	Local liRetVal 				as Long
	Local hDC 					as ptr
	Local ps						is _WINPAINTSTRUCT
	Local lpfnDefaultProc 			as ptr
	LOCAL oIcone as icon
	Local Static hBitMap			as ptr
	Local Static siWhichToPaint 	as ShortInt
	Local Static pszText			as psz
	
	// This eliminates a global -
	// The original window procedure address is still accessible by querying the window class info
	// Presumes the window hasn't already been subclassed before, not likely in this case.
	lpfnDefaultProc :=  GetClassLong( hWnd,  GCL_WNDPROC ) 	// Get VO's default window procedure

	do Case

	// WM_USER messages to set up desired behavoir
	Case uMsg == WM_USER + 4
		hBitMap := word( _cast, lParam )
		siWhichToPaint := 3
		Return( 0L )
	// These are the only messages we want to act on, let VO do the rest
	Case uMsg == WM_PAINT
		hDC := BeginPaint( hWnd, @ps )

		// Draw the Bitmap
		CentreBitMap( hWnd, hDC, hBitMap )

		// Draw the Icon
		oIcone := _My_ICON{}
		DrawIconEx( hDC, 50, 50, oIcone:Handle(), oIcone:size:width, oIcone:size:height, 0, 0, DI_NORMAL)

		EndPaint( hWnd, @ps )
		Return( 0L )
	Case uMsg == WM_SIZE
		// Force a complete repaint for the new size
		InvalidateRect( hWnd, null_ptr, true )
		liRetVal := CallWindowProc(  lpfnDefaultProc , hWnd, uMsg, wParam, lParam )		
	Case uMsg == WM_ERASEBKGND		
		If siWhichToPaint != 3
			Return( 0L )						
		Else
			liRetVal := CallWindowProc(  lpfnDefaultProc , hWnd, uMsg, wParam, lParam )		
		Endif
	Otherwise
		// Let VO's orig WinProc handle the rest of the messages
		liRetVal := CallWindowProc(  lpfnDefaultProc , hWnd, uMsg, wParam, lParam )
	EndCase
Return( liRetVal )
Function CentreBitMap( hWnd as ptr, hDC as ptr, hBmp as ptr ) as void Strict
	Local rc				Is _WINRECT
	Local hMemDC 	 	As Ptr
	Local hOldBitMap		As Ptr
	Local struNewBitMap	As _WINBITMAP					
	Local siXOffSet		As ShortInt
	Local siyOffSet		As ShortInt
	Local lStretch			As Logic
	
	lStretch 	:= False	

	// Get the size of the window for the bitmap
	GetClientRect( hWnd, @rc )

	// Allocate the memory for a bitmap structure
	struNewBitMap 	:= MemAlloc( _SizeOf( _WINBITMAP ) )

	// Create a compatible memory DC
	hMemDC := CreateCompatibleDC( hDC )
	
	// Save whatever was the old SelectedObject and select this object
	hOldBitMap := SelectObject( hMemDC, hBmp )
	
   // Make the mapping mode the same as the target device, whatever that is
	SetMapMode( hMemDC, GetMapMode( hDC ) )
	
	// Fill in the structure with the bitmap's width, height and colour format
	GetObject( hBmp, _SizeOf( _WINBITMAP ), StruNewBitMap )
	
	// Now we have the width and height of the bmp
	// If the window is wider than the bitmap, work out how to centre it
	If ( rc.Right - rc.Left ) > struNewBitMap.bmWidth
		siXOffSet := (( rc.Right - rc.Left) - struNewBitMap.bmWidth)/2
	Else
		siXOffSet := 0
		// If the window is smaller than the bitmap, we have to stretch the bitmap to fill the window
		If ( rc.Right - rc.Left ) < struNewBitMap.bmWidth
			lStretch := True
		Endif
	Endif

	// If the window is taller than the bitmap, work out how to centre it.
	If ( rc.Bottom - rc.Top ) > struNewBitMap.bmHeight	
		siyOffSet := (( rc.Bottom - rc.Top) - struNewBitMap.bmHeight) /2
	Else
		siYOffSet := 0		
		// If the window is smaller than the bitmap, we have to stretch the bitmap to fill the window
		If rc.Bottom - rc.Top < struNewBitMap.bmHeight
			lStretch := True
		Endif
	Endif

//	If lStretch
		// I always show the bitmap streched.
		StretchBlt( hDC, rc.Left, rc.Top, rc.Right , rc.Bottom , hMemDC, 0,0, struNewBitMap.bmWidth, struNewBitMap.bmHeight, SRCCOPY )
//	Else
		// this shows the bitmap real size.
//		BitBlt( hDC, rc.Left + siXOffset, rc.Top + siYOffSet, (rc.Right - rc.Left ), ( rc.Bottom - rc.Top), hMemDC, 0,0, SRCCOPY )
//	Endif

	// Clean up
	SelectObject( hMemDC, hOldBitMap )
	DeleteDC( hMemDC )
	MemFree( struNewBitMap )
Return nil



Best regards,
Fábio.



> Hi Fábio,
> 
> Please send me some samples.
> 
> Thanks
> 
> Paulo

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web