jaishni
15th July 2002, 13:08
hi,

I am facing an important with useful problem as I want to display a picture on a form.

for example, we have pay-roll package in baan where I want to display the photo of each employee on form according to their employee code & name.

How could I achieve my goal

Again I tell that I want to display picture on form.

I will be thankful, if anyone provide me solution.

Regards

Sakhnini
15th July 2002, 13:47
Baan Hot link makes this possible.

check the attached GIF

http://www.nazdaq.co.il/demo/bhl15p4a.GIF

jaishni
15th July 2002, 15:35
this is not what i want ,

i want to display photo of employee as well as his details on form in baan how could i do that

NPRao
15th July 2002, 20:40
Hi Jai,

Please refer to the link in this forum-

http://www.baanboard.com/baanboard/showthread.php?s=&threadid=5554

~Vamsi
15th July 2002, 22:41
This question was asked and answered on Baanfans a few years ago. I am posting all the threads I believe are related to this subject. Please post a final code release to Code & Utilities if this results in useable code. Grzegorz's website link is unreachable. Perhaps he can share his code with us.

~Vamsi

Ivan Simeonov posted Message on May 19, 1999 at 05:30:09 EST

The following code is just an idea, to show employee picture in Maintain Emploees Session.


long pixid, w, h, z |#BG002
long toplevel


#include "itgbrgeditor"
#include "itgbrg0001"
....

form.1:
after.form:
if toplevel then
destroy.object (toplevel)
toplevel = 0
endif

before.form:
string picture.name(250)

picture.name = tccom001.photo
if not (strip$(picture.name) = "") then
toplevel = create.object( DsCgwindow, current.mwindow(),
DsNwidth, 160,
DsNheight, 160,
DsNx, 550,
DsNy, 60 )

pixid = load.pixmap.file(bse.dir$() & "/photos/" & picture.name, w, h)
if pixid then
create.sub.object(toplevel, DsCgpImage,
DsNx, 5,
DsNy, 5,
DsNwidth, w,
DsNheight, h,
DsNpixmap, pixid )
endif
update.object( toplevel )
endif



Vineet Sawant posted Message on June 12, 1999 at 01:04:42 EST


Hi everyone,
Ever wanted to see Logo on your BaaN screens?? Do all this and more with the steps given below. The code for this is
there in BaaN Tools itself!! Read the section on Create.Object (3 GL function), the example given at the end can be copied almost as it is , with a few changes. Works for NT as well as UNIX.

PUT THIS CODE INTO INIT.FORM for ANY SESSION. THE GIF WILL BE DISPLAYED ON THE XPOS,YPOS THAT YOU SPECIFY.You must have source code (program script) for that session.

long cmap(256)
long cmap_sz
string imap(1) based

long icon_w
long icon_h
long valid.icon

long gwin
string file(128)
string bufr(1) based
long buflen, fp
long idc, idp, image

gwin = create.object(DsCgwindow,current.mwindow(),
DsNbackground, <Long Color>,
DsNx, <Long Xpos>,
DsNy, <Long ypos>,
DsNwidth, <Long WIDTH OF YOUR GIF file>,
DsNheight, <Long HEIGHT OF YOUR GIF file>,
DsNpointerCursor, DSCHAND,
DsNeventMask, EVTALLEVENTMASK )

file = "${BSE}/gif/desktop.gif/<yourgif>"|YOUR GIF file here
fp = seq.open(file, "r")

buflen = seq.seek(0, 2, fp)
alloc.mem(bufr, buflen)
seq.rewind(fp)
seq.read(bufr, buflen, fp)
seq.close(fp)

if get.pixmap.info(bufr, cmap_sz, icon_w, icon_h) then
alloc.mem(imap, icon_w * icon_h)
valid.icon = decompress.pixmap(bufr, cmap, imap)
cmap(1) = rgb(128,128,128)
endif

free.mem(bufr)
update.object(gwin)
idc = create.object(DsCcolormap,current.display(),DsNcolorTable,cmap,cmap_sz)

idp = create.object(DsCpixmap,current.display(),
DsNcolormap, idc,
DsNwidth, icon_w,
DsNheight, icon_h,
DsNdata, imap, icon_w * icon_h,
DsNdataType, DSPIXMAP8 )

image = create.sub.object(gwin, DsCgpImage,
DsNpixmap, idp,
DsNx, 0,
DsNy, 0 )

POINTS TO REMEMBER:
Copy your GIF file to any of the subdirectories under $BSE/GIF..such as desktop.gif, etc. Remember thses are directories, not GIF files. Then, RENAME your .GIF file such that it does not have the .GIF extension..ie rename VIN.GIF to VIN, even for NT.

Its surprising , you can do things in BaaN you never thought possible, and the code is there , hidden away in BaaN Tools Help.
If any of you have any such stuff to share , please share it with all of us BaaN developers. It makes our normal mundane BaaN lives much more interesting!

Grzegorz posted Message on January 05, 2001 at 15:56:47 EST

: Hello pretty baanfans, i'm triyng to put an icon .gif in a normal session of BaaN. I know i have to use "create.object" functions, but the help is very confuse... Anybody has an example?
: Thanks. Kisses.

Please see at http://www.dst.com.pl/oferta/of_baan_szp_kadry.htm
Look at second screenshot (employee data with picture).If this is what you want to get, pls email me.

Regards
Grzegorz.

Ulrich Fuchs posted Message on January 08, 2001 at 06:09:15 EST

: Hello pretty baanfans, i'm triyng to put an icon .gif in a normal session of BaaN. I know i have to use "create.object" functions, but the help is very confuse... Anybody has an example?
: Thanks. Kisses.


Following is something that I tried out after a posting of someone within that forum:

form.1:
init.form:


long cmap(256)
long cmap_sz
string imap(1) based

long icon_w
long icon_h
long valid.icon

long gwin
string file(128)
string bufr(1) based
long buflen, fp
long idc, idp, image

gwin = create.object(DsCgwindow,current.mwindow(),
DsNbackground, 0,
DsNx, 30, | YOUR GIFs POSITION HERE
DsNy, 100,
DsNwidth, 110, | YOUR GIFs WIDTH & HEIGHT HERE
DsNheight, 120,
DsNpointerCursor, DSCHAND,
DsNeventMask, EVTALLEVENTMASK )

file = "${BSE}/gif/Auroflex/deskt01/delete01"|YOUR GIF file here - NAME IT WITHOUT THE .gif EXTENSION!
fp = seq.open(file, "r")

buflen = seq.seek(0, 2, fp)
alloc.mem(bufr, buflen)
seq.rewind(fp)
seq.read(bufr, buflen, fp)
seq.close(fp)

if get.pixmap.info(bufr, cmap_sz, icon_w, icon_h) then
alloc.mem(imap, icon_w * icon_h)
valid.icon = decompress.pixmap(bufr, cmap, imap)
cmap(1) = rgb(128,128,128)
endif

free.mem(bufr)
update.object(gwin)
idc = create.object(DsCcolormap,current.display(),DsNcolorTable,cmap,cmap_sz)

idp = create.object(DsCpixmap,current.display(),
DsNcolormap, idc,
DsNwidth, icon_w,
DsNheight, icon_h,
DsNdata, imap, icon_w * icon_h,
DsNdataType, DSPIXMAP8 )

image = create.sub.object(gwin, DsCgpImage,
DsNpixmap, idp,
DsNx, 0,
DsNy, 0 )

NPRao
16th July 2002, 00:06
Hi Vamsi,

Thats was great posting...!!! :p

I tested the solution, the 2nd code worked fine...

However, I am getting compilation error for the 1st coding you posted -


pzmadmtest0( 140): Error: Unresolved reference to function 'load.pixmap.file'.


Any clues ?? :confused:

I was thinking in the line of making a gif editor, something which we had on the TCS in BaaN. :cool:

Thanks!

~Vamsi
16th July 2002, 00:32
Prashanth,

I usually have no problem accepting laurels. But in this case I must decline :). The original posting was from IIS (Ivan). Then Vineet posted a different piece and finally Ulrich posted some more code. I have reposted some of the code earlier too and each of those gentlemen may have used each others ideas.

Why does the code not work? I have no clue :). This code does not have much interest for me at this moment.

Grzegorz had a similar piece of code working which he showcased on his website. He was willing to share his code with the lady who offered kisses all around ;).

Now that folks have a starting point for this code, will someone make it easy to link pictures to records. For example product pictures on Items session and employee pictures on Employees session.

jaishni
16th July 2002, 10:26
thanks everybody for replying me

but that is not actually what i want


suppose if i have 100 employees and i want to display 100 photes of employees with their details according to ur code i will have to saperately write the code for each employee

i want to change the photo of emp. as soon as the details changes for different emp.

like when i click on next record of next employee the picture of next employee should display automatically

i will be very thankful if any one provide me solution.

NPRao
16th July 2002, 10:54
Jai,

You have to code as below to handle the current record of the table and get the picture info in your function to display -


for i=1 to filled.occ
if mark.table(i) then
do.occ(i, some_function)
endif
endfor

© 1998 Baan Development B.V. All rights reserved

~Vamsi
16th July 2002, 20:09
Ok folks - time out!

Prashanth - if you were to display the picture it will have to be in the single-occ and not on the multi-occ session. So there is no need to do the stuff you outlined. Perhaps you are thinking of launching a picture from the specific menu. The ideal solution would be that the picture just appears just like any other field on the single-occ.

Jaishni, the base code is already provided. If you name the gif files same as the primary key of tccom001 you should be pretty close to the solution. If that does not make sense, please contact www.dst.com.pl or www.rmcis.com and they will probably be willing to provide you with a solution for a fee.

jaishni
24th July 2002, 10:27
thanks everybody,

I think that been enough by passing each and everybody thoughts ,

I have an idea and feel that it would be nice punch if we try that

like i create a program for photo display with employee's detail IN VISUAL BASIC and intigrate that program with baan

exp:

if i go through baan module i should be able to open it in BaaN Menu not in external resources.

if any one has idea upon this matter plz send me immediately

thanks

NPRao
24th July 2002, 22:56
Hi Jai,

I wouldnt extend any more functionality if its already available in standard BaaN.


New functionality in BaanERP 5.2a
Difference Study iBaanERP 5.0c - 5.2a3-19

3.4 Dynamic Form Editor (DFE)

This section describes the DFE’s new functionality in BaanERP 5.2a.

3.4.1 Pictures on forms

In BaanERP 5.2a, you can use the DFE to insert a picture (gif format) on a session’s form. The picture you insert must be in the Icon Groups (ttdsk9100m000) session in the icon group form_<pp>, where pp is the package code of the session whose form you want to insert the picture on.

To insert a picture on a session’s form with the DFE:

1 Select Insert ►Picture, or click the picture icon on the toolbar. The picture properties dialog box appears:
Figure 3-19 The DFE’s Picture properties dialog box.

2 Click the zoom button on the Icon field. The ttgbf0005m000 window appears with the icons available to you. Select your icon.

3 You can select the:
−−−−Details Session check box for the picture to appear on the details session’s form.
−−−−Overview Session check box for the picture to appear on the overview session’s form.
−−−−Child Field(s) Behind check box to place the picture’s child field(s) (if any) immediately behind the picture.

4 If you want a label for your picture, enter the required details in the fields of the Label box.

5 Click OK.

You can use the programming function long.change.picture()to
change the picture on a form at runtime. The picture you use to replace the existing picture must also belong to the icon group form_<pp> in the Icon Groups (ttdsk9100m000) session.


I guess Vamsi has give good ideas and *timed out* this discussion. :p

Caner.B
25th July 2002, 14:20
Hi ,
is it also possible to display jpg. and dwg files on the from .

and are there any zoom or print properties availble.

thanks

Caner

sweetie
22nd August 2002, 15:07
Vamsis code is working.
But when changing the gif with my proper gif file, the gif was displayed 3 or 4 times.
After a little research i discoverd that you have to save the gif files in the normal way not in the interleaced way.
In photoshop MS i did not found the option, using acrobat photoshop it is asked when you save a file in the gif format.

hsteenwi
23rd August 2002, 17:04
Vamsi,

In name of our programmers, I have to thank you for the coding you posted. I passed it on to them, and they've not been doing their job until this moment, being happy as children with all kinds of pictures on their forms.

In short: great stuff!


Henk.

~Vamsi
23rd August 2002, 19:33
Henk,

Please post back any improved code back to the board. Especially if you use it in production environment, post it to the Code & Utilities forum.

As for thanking me ... wish I could accept the laurels. I have quoted all the sources. But here they are again. The following people had posted the source at various times - either they were the authors or they were just reposting after refining the code.

Ivan Simeonov
Vineet Sawant
Ulrich Fuchs
Grzegorz


Again, my contribution to this piece of code is zero :).

hsteenwi
26th August 2002, 07:42
Vamsi,

May the thanks I expressed spread out over the people you mention...

Our programmers are, as I said earlier, experimenting with the coding. Any interesting improvements they might stumble upon I will ofcourse share with those who love BaaN or who are, in any way, forced to live with it.


Henk.

NvanBeest
8th September 2003, 16:26
Found the following function in ottdllinstall on BaanIV:
function extern long display.picture( const string gif.file(), long xpos, long ypos )Anybody ever tried to use it?

NvanBeest
8th September 2003, 18:17
Don't bother to try! I had some time to kill, and called it in many different ways, from different sections in a 4GL script, and no luck! :( The code ~Vamsi gathered does work, so I'm using that now.

justknowledge
26th August 2008, 11:31
Hi everyone,

I am working on ERP LN and waana add picture to my form through DFE 7.6a verison however i don't find any icon toolbar or picture properties in DFE.

Can anybody tell me if i need to use other version of DFE if yes then plz. provide me link to it.

or if there is any other issue plz. update me.

Regards

NPRao
26th August 2008, 21:32
I am working on ERP LN and waana add picture to my form through DFE 7.6a verison however i don't find any icon toolbar or picture properties in DFE.
The feature has been removed from the DFE.
Refer to knowledge base on Baan support site:
SolutionID 134208
CreatedBy Not Known
CreatedOn 2003-04-24
ModifiedBy Not Known
ModifiedOn 2003-04-24
StatusDescription Published
TypeDescription QR: Error Standard Software

Solution Description
English DFE Version 7.3a.28 : option Insert Picture removed from DFE menu

Joy Conner
16th July 2009, 17:03
I am working on the display of gif images. I have used code posted in this thread and my image is displayed.:D The only change I made to the code is the location of it's call. This thread executes the image display during the init.form. I have the code in a function, display.image() and have called it from the following places:

main.table.io:
after.read:

choice.find.data:
on.choice:

field.table.photo:
when.field.changes:
before.display:
after.display:


The name of the image is stored in table field. I am expecting the image to change when navigating from one record to the next. The form type is a single occurrance.

The problem that I am having is sometimes the image is displayed as a black block on the form. :confused: I have posted an example. The attachment is a screen image of the same record. On one, the image is correct, on the other, the image is displayed is a block rectangle.

Any ideas on what might cause this?

This may not be pertinent but I have observed when I navigate from one record to the next quickly, I see more black rectangles. When I allow some time to pass; I count to 6 slowly; then I see less black rectangles.