Dental program

Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Post by Willy »

Antonio Linares wrote:Willy,

Please email me those bitmaps, thanks.
Sended

By
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Willy,

Do it this way: (warning: don't use ADJUST clause)

Code: Select all

#include "FiveWin.ch"

Function Test() 

   Local oDlg, oBmpColor , oBmpBlackWhite 

   Local cTitle := "Testing" 

   DEFINE DIALOG oDlg FROM 0,0 TO 320, 280 TITLE cTitle Pixel // 500 Width 

   @ 0, 0 Bitmap oBmpBlackWhite Filename "01-01.Bmp" Of oDlg Pixel // 100 High 

   @ 0, 110 Bitmap oBmpColor Filename "01-00.Bmp" Of oDlg Pixel // 100 High 

   oBmpBlackWhite:bLClicked := {|nRow,nCol|GetZone(nRow,nCol,oBmpColor,oDlg)} 

   ACTIVATE DIALOG oDlg CENTERED On Init oBmpColor:Hide() 

Return Nil 

************************************************************** 
Static Function GetZone(nRow,nCol,oBmpColor,oDlg) 

local hDC := CreateCompatibleDC( oDlg:GetDC() )
local hOldObj := SelectObject( hDC, oBmpColor:hBitmap )
Local nColor := GetPixel( hDC, nCol,nRow ) 

   SelectObject( hDC, hOldObj )

   oDlg:ReleaseDC() 
   DeleteDC( hDC )

   ? "Kleur : " + AllTrim(Str(nColor)) , "Col : " + AllTrim(Str(nCol)) , "Row : " + AllTrim(Str(nRow)) 

Return Nil
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Post by Willy »

Hello,

I had some version problems between FWH and xHB. Now they are solved.

So I could restart testing.

The example you gave is working fine now.

So I can start with the next point.

Thanks Antonio.
Willy
Posts: 117
Joined: Thu Mar 02, 2006 11:06 am
Location: Belgium

Post by Willy »

Antonio Linares wrote:Willy,

oBmp1:bPainted = { | hDC | TransBmp( oBmpX:hBitmap, oBmp1:nWidth(), oBmp1:nHeight(), nClrTransparent, hDC, 0, 0, oBmp1:nWidth(), oBmp1:nHeight() }
Hello,

This gaves also some problems.

Is there a working example of TransBmp() or a description. I do'nt find anything in the manual.

Has it to be called from inside the object by a method.

Is oBmpX simply a bmp that can be loaded via LoadBmp()

Sorry for the trouble. But I think this is very undocumented and it can be very usefull for a lot of users.

Greetings
Willy
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Willy,

> This gaves also some problems.

What problems are them ?

>
Is there a working example of TransBmp() or a description. I do'nt find anything in the manual.
>

No, it is not documented yet as it was recently added and modified.

> Has it to be called from inside the object by a method.

You can call it everywhere as far as you provide it the right parameters.

> Is oBmpX simply a bmp that can be loaded via LoadBmp()

You may use LoadBitmap( GetResources(), cResName ) --> hBitmap

warning: it returns a bitmap handle, not a Class TBitmap object.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Silvio
Posts: 3107
Joined: Fri Oct 07, 2005 6:28 pm
Location: Teramo,Italy

Post by Silvio »

Antonio, Wich theme use into your pc '
It is very beautifull I'd like to have it ...
Best Regards, Saludos

Falconi Silvio
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Silvio,

Thats Windows Vista (with "Aero"), not XP :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply