Dental program
Dental program
Hello,
A dentist asked me to explore te possibilities to write a dental program.
Normaly a relational database is not a problem.
But a dental program has something specific.
They start from a map with teeth.
They click on one tooth and there comes a graph with that thoot divided in
several parts.
Then they select the parts of the tooth where they are working on.
Is it possible in xHarbour to design a graphical set of teeth in wich I can
select some parts.
What I mean is : Can I show a graph on a screen and select a sub-graph
Thanks a lot.
Willy Hermans.
A dentist asked me to explore te possibilities to write a dental program.
Normaly a relational database is not a problem.
But a dental program has something specific.
They start from a map with teeth.
They click on one tooth and there comes a graph with that thoot divided in
several parts.
Then they select the parts of the tooth where they are working on.
Is it possible in xHarbour to design a graphical set of teeth in wich I can
select some parts.
What I mean is : Can I show a graph on a screen and select a sub-graph
Thanks a lot.
Willy Hermans.
areang,
It is not that simple.
Indaed the first part is. I can add a teeth in a graphical button or I can click on a bmp because they are placed alongside.
But some teeth are divided in 24 zones. These zones are not regulary squares. They are just like pieces af a puzzle.
Each piece can have undergo a different treatment. Depending on that treatment it should have a different color.
So when a dentist select a patient, the system does not have to display a standard set of teeth.
The system has to display the actual set of that patient.
Displaying it teeth by teeth and sub-teeth by sub-teeth means moere then 500 graphs.
It should be very slow.
I thought there has been a third party app with which it is possible to draw maps and select one map into another. Maybe this can be useful.
Can someone tell me where I can find this.
Thanks
Willy Hermans
It is not that simple.
Indaed the first part is. I can add a teeth in a graphical button or I can click on a bmp because they are placed alongside.
But some teeth are divided in 24 zones. These zones are not regulary squares. They are just like pieces af a puzzle.
Each piece can have undergo a different treatment. Depending on that treatment it should have a different color.
So when a dentist select a patient, the system does not have to display a standard set of teeth.
The system has to display the actual set of that patient.
Displaying it teeth by teeth and sub-teeth by sub-teeth means moere then 500 graphs.
It should be very slow.
I thought there has been a third party app with which it is possible to draw maps and select one map into another. Maybe this can be useful.
Can someone tell me where I can find this.
Thanks
Willy Hermans
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Willy,
> The system has to display the actual set of that patient.
That would make it much more complex as you would need a kind of OCR for each patient set.
If you could use a unique model, then you may use a second bitmap with a colors map, and based on the selected color, you will know what part has been selected.
> The system has to display the actual set of that patient.
That would make it much more complex as you would need a kind of OCR for each patient set.
If you could use a unique model, then you may use a second bitmap with a colors map, and based on the selected color, you will know what part has been selected.
> If you could use a unique model, then you may use a second bitmap with a
> colors map, and based on the selected color, you will know what part has
> been selected.[/quote]
Antonio,
I was already thinking of starting with a unique model.
Then I keep a memo field for each patient.
44\02:12\03:12
38\07:16\08:16
could mean
Teeth 44 color 12 for zones 2 and 3
Teeth 38 color 16 for zones 7 and 8
Those zones should be paint over the uniqe model.
Most zones are stying white.
It keeps impossible to select a zone by just clicking in it.
I think that is the difficult part where I look for a solution.
Thanks for the reply Antonio.
Greetings
Willy Hermans.
> colors map, and based on the selected color, you will know what part has
> been selected.[/quote]
Antonio,
I was already thinking of starting with a unique model.
Then I keep a memo field for each patient.
44\02:12\03:12
38\07:16\08:16
could mean
Teeth 44 color 12 for zones 2 and 3
Teeth 38 color 16 for zones 7 and 8
Those zones should be paint over the uniqe model.
Most zones are stying white.
It keeps impossible to select a zone by just clicking in it.
I think that is the difficult part where I look for a solution.
Thanks for the reply Antonio.
Greetings
Willy Hermans.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Willy,
> It keeps impossible to select a zone by just clicking in it.
Its easy but little tricky
You have two bitmaps, one with the set picture and another with only colors, one different color for each area. This second one is hidden.
When the user clicks on the picture, you know the row and col of the mouse, and do a GetPixel( oBmp2:GetDC(), nRow, nCol ), oBmp2:ReleaseDC() on the _second_ bitmap. Based on the color you get with GetPixel(), you know what area was selected.
> It keeps impossible to select a zone by just clicking in it.
Its easy but little tricky
You have two bitmaps, one with the set picture and another with only colors, one different color for each area. This second one is hidden.
When the user clicks on the picture, you know the row and col of the mouse, and do a GetPixel( oBmp2:GetDC(), nRow, nCol ), oBmp2:ReleaseDC() on the _second_ bitmap. Based on the color you get with GetPixel(), you know what area was selected.
Thanks Antonio,
This is already a big step.
I set up a test app to try this.
But then the next step is also dificult in FW
Once I've selected a treathment (from a listbox) I click on a zone in a tooth.
The zone will be detected by the background bitmap. Then this zone has to be colored in the foreground bitmap in the color corresponding with the treathment.
Is there a way to acces the bitmap in memory and to refresh it ?
This is already a big step.
I set up a test app to try this.
But then the next step is also dificult in FW
Once I've selected a treathment (from a listbox) I click on a zone in a tooth.
The zone will be detected by the background bitmap. Then this zone has to be colored in the foreground bitmap in the color corresponding with the treathment.
Is there a way to acces the bitmap in memory and to refresh it ?
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Hello,
I've done some tests.
I did what you said with a screen designed in Borland Resource Workshop.
It works fine when I place the two bitmaps on the screen - both visible.
When I make the colored bitmap invisible with
| NOT WS_VISIBLE
It did not work anymore.
I tried to be smart and placed the second bitmap out the range of the screen.
No succes.
I placed the second bitmap after the first (by setting the order in workshop)
No succes.
Is it possible that your solution only works without workshop.
Thanks,
Willy Hermans
I've done some tests.
I did what you said with a screen designed in Borland Resource Workshop.
It works fine when I place the two bitmaps on the screen - both visible.
When I make the colored bitmap invisible with
| NOT WS_VISIBLE
It did not work anymore.
I tried to be smart and placed the second bitmap out the range of the screen.
No succes.
I placed the second bitmap after the first (by setting the order in workshop)
No succes.
Is it possible that your solution only works without workshop.
Thanks,
Willy Hermans
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Antonio,Antonio Linares wrote:Willy,
Hide the second bitmap from the ON INIT clause of the DIALOG:
ACTIVATE DIALOG oDlg ON INIT oBmp2:Hide()
Don't use any special flags at the resources workshop.
This is the code I tested.
When the colored bitmap is visible its works.
However when it is not visible (hided, outside te range of the form ...) it does not work.
Function Test()
Local oDlg, oBmpColor , oBmpBlackWhite
Local cTitle := "Testing"
DEFINE DIALOG oDlg FROM 0,0 TO 200, 500 TITLE cTitle Pixel // 500 Width
@ 0, 0 Bitmap oBmpBlackWhite Filename cDataDict+"\BitMaps\01-01.Bmp" Size 80 , 100 Of oDlg Adjust Pixel // 100 High
@ 0,110 Bitmap oBmpColor Filename cDataDict+"\BitMaps\01-00.Bmp" Size 80 , 100 Of oDlg Adjust Pixel
* @ 0,110 Bitmap oBmpBlackWhite Filename cDataDict+"\BitMaps\01-01.Bmp" Size 80 , 100 Of oDlg Adjust Pixel // 100 High
oBmpBlackWhite:bLClicked := {|nRow,nCol|GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)}
oBmpColor:bLClicked := {|nRow,nCol|GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)}
* ACTIVATE DIALOG oDlg CENTERED On Init oBmpColor:Hide()
ACTIVATE DIALOG oDlg CENTERED
Return Nil
**************************************************************
Static Function GetZone(nRow,nCol,oBmpColor,oBmpBlackWhite)
Local nColor := GetPixel( oBmpColor:GetDC(), nCol,nRow)
? "Kleur : " + AllTrim(Str(nColor)) , "Col : " + AllTrim(Str(nCol)) , "Row : " + AllTrim(Str(nRow))
oBmpColor:ReleaseDC()
Return Nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: