on 06-16-2016 10:25 PM
i try to make patient app to store data of patients
I want to display image Swollen Joint Count (44 Joints) )
in my app and let the user to select some joint on this image and the count of this selected joints (display in the picture ) then i want to save it in my database with the selected joints which the user select it,
how can i do this ???
the patient may have more thane one picture
when i retrieve data i want to retrieve on picture only according to some criteria
If you are patient enough, paint the circles on top of the image in a datawindow.
Use modify to change colour at run time when the user clicks them.
All you need to store the database is the names/numbers of the circles selected.
When re-retrieving re-select them for display, printing etc.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have started and attached a datawindow
It refers to the image hd_hglt.gif with no directory specified so you will need that available in the current directory or point it to the right place and name.
I have painted two circles. the pen style is currently red. You can change that.
To create more, just duplicate them and move them, resize and rename them.
In the clicked event dwo.name will tell you which circle was clicked
In source each circle is defined like this:
ellipse(band=detail x="1769" y="340" height="164" width="192" name=c2 visible="1" brush.hatch="6" brush.color="16777215" pen.style="0" pen.width="14" pen.color="255" background.mode="2" ba...
To toggle the pen colour between red and black:
string lsName
lsName = dwo.name
if describe ( lsName + '.pen.color' ) = '255' then
Modify ( lsName + '.pen.color=0' )
else
Modify ( lsName + '.pen.color=255' )
end if
HTH
Lars
Personally I would not save the pictures at all. I would save the names or numbers of the selected joints as a string.
Above I called them c1, c2 etc.
So before saving, in a loop check if a joint is selected:
string lsSelected, lsName
long lRow, lJoints = 42 //???
for lRow = 1 to lJoints
lsName = 'c' + string ( lRow)
if describe ( lsName + '.pen.color' ) = '255' then
lsSelected += lsName + ','
end if
next
dw... setItem ( 1 , 'joints' , lsSelected )
Similarly when displaying from database
loop through and set the color='255' for the previously selected
Hi Ahmed;
My application actually modifies the original image by calling the ImageMagicK open source software to render the changes to the displayed image.
In your case though, I would assume that you want to preserve the original image but also, the workup on the image overlay which indicates what points on the joints the person reviewing wanted to emphasize.
In your case, I would suggest Incorporating the image & workup overlay within a DataWindow. That way, you can save the whole workup in one easy step by saving the DW source code as a blob in your DB. Then to restore the entire image + workup, read the DW source back from the Blob & issue a Create () method to rebuild the DWO "exactly" what it looked like in the workup process. Also, this DW source approach would make the coding easy compared to restoring the original DW - then trying to restore all the overlay work drawing object, by drawing object!
Food for thought.
Regards ... Chris
Hi Ahmed;
That is easy ...
1) use a LOB data type for your picture column in a DB table.
2) use an UpdateBlob command in PB to add the picture to your DB LOB based column.
3) Use a SelectBlob command to read your picture into your PB application.
4) then use a Picture Control to display the image on your PB windows.
Note: if your on PB 12.5.x or higher ... have a look at the DataWindow's Table Blob feature. The DW can now automatically accomplish #2,#3, and #4 all in one object.
HTH
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ahmed;
Here is an example of an application system I wrote that stores images as blobs and then renders them in a DataWindow (or you could have used a Picture Control). The user can then flip, rotate, invert the image, OCR it and have the OCR point to something of interest - then finally, float a toolbar over the image where the user can mark various areas of the image and them process them (we use ImageMagic free open source for that).
I just demonstrated this application in the last webinar I did on PowerBuilderTV. You can view the recorded presentation (click here😞
If you are interested, I can also send you the source code for the DEMO application I used. Its written in PB v12.1 and uses hidden DataWindow drawing objects that are made visible and moved in ways similar to what Lars was suggesting.
The Demo application runs natively as a Win32 - however, the actual production application runs as a web browser application courtesy of Appeon Web.
HTH
Regards ... Chris
Hi Chris
I send you my email
If you did not receive it
it is ahtawfik at yahoo
note that
only i can load picture on my app as in your example
https://scn.sap.com/thread/3783940
i use PB 12.5.x
but i can not edit it as Lars say
I wish your code show me how to solve this
Regards Ahmed ;
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.