My Dear friends , forgive me because i am novice in OOP and GUI Environment ,,
it was long time ago working with Borland's Turbo prolog ...
working via Visual prolog 7.2 PE Now ...
I Have a Main form that Holds Main patient Data .. like shown in picture (workboard_1) .
I wish if i Can add Image for the patient in the upper right corner at small window area .
like shown in picture workboard_2 ..
what the steps should i take to do this .. ??
and what is the type of control should i Use and how ??
thanks ...
abdelrahman
-
- Posts: 14
- Joined: 13 Sep 2009 6:23
How can i add image from jpg file to small area window in my form .
You do not have the required permissions to view the files attached to this post.
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01
Hi,
One way here : http://discuss.visual-prolog.com/viewto ... agecontrol
One way here : http://discuss.visual-prolog.com/viewto ... agecontrol
-
- Posts: 14
- Joined: 13 Sep 2009 6:23
My Dear Tonton , Thank you for your Directive Link ..
My Dear Tonton , Thanks for your Link ...
The following code has been worked for " *.bmp " images and that is well ..
predicates
onPaint : drawWindow::paintResponder.
clauses
onPaint(_Source, _Rectangle, GDI):-
Dir= directory::getCurrentDirectory(),
FileName=string::concat(Dir,"\\pt_pics\\bdc.bmp"),
Pic=vpi::pictLoad(fileName(FileName),100,100,0x0020),
GDI:pictdraw(Pic,pnt(650,5),rop_SrcCopy).
Thank you for your continuous Help...
abdelrahman
The following code has been worked for " *.bmp " images and that is well ..
predicates
onPaint : drawWindow::paintResponder.
clauses
onPaint(_Source, _Rectangle, GDI):-
Dir= directory::getCurrentDirectory(),
FileName=string::concat(Dir,"\\pt_pics\\bdc.bmp"),
Pic=vpi::pictLoad(fileName(FileName),100,100,0x0020),
GDI:pictdraw(Pic,pnt(650,5),rop_SrcCopy).
Thank you for your continuous Help...
abdelrahman
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01

Code: Select all
facts
mem_pic:picture:=erroneous.
predicates
onPaint : drawWindow::paintResponder.
clauses
onPaint(_Source, _Rectangle, GDI):-
if isErroneous(mem_pic),
Dir= directory::getCurrentDirectory(),
FileName=string::concat(Dir,"\\pt_pics\\bdc.bmp"),
file::existFile(FileName) then
try
mem_pic:=vpi::pictLoad(fileName(FileName),100,100,0x0020)
catch _ do
succeed()
end try
end if,
if not(isErroneous(mem_pic)) then
GDI:pictdraw(mem_pic,pnt(650,5),rop_SrcCopy)
end if.
-
- Active Member
- Posts: 29
- Joined: 3 Apr 2014 8:32
-
- VIP Member
- Posts: 1466
- Joined: 28 Feb 2000 0:01
Actually, I would advise you not to put images on buttons. If you look around you will notice that buttons do not have images (except in web pages and games).
But if you insist then you should use button::setImageList:
But if you insist then you should use button::setImageList:
Code: Select all
predicates
setImageList : (imageList ImageList).
setImageList : (imageList ImageList, integer LeftMargin, integer TopMargin, integer RightMargin, integer BottomMargin, imageAlign Align).
% @short Set an #ImageList for the button (margins default to 0, #Align defaults to alignLeft)
% @details #ImageList can either contain a single image,
% or it can contain images corresponding to the states PBS_NORMAL, PBS_HOT, PBS_PRESSED, PBS_DISABLED, PBS_DEFAULTED and PBS_STYLUSHOT.
% #LeftMargin, #TopMargin, #RightMargin and #BottomMargin specifies additional margins around the image.
% #Align specifies the placement of the image on the button.
% @end
Regards Thomas Linder Puls
PDC
PDC
-
- Active Member
- Posts: 29
- Joined: 3 Apr 2014 8:32
i tried to add 2 images instead of 1 but i have an error .
this is the program :
this is the program :
Code: Select all
predicates
onPaint : drawWindow::paintResponder.
clauses
onPaint(_Source, _Rectangle, GDI):-
Dir= directory::getCurrentDirectory(),
FileName=string::concat(Dir,"\\pt_pics\\bdc.bmp"),
Pic=vpi::pictLoad(fileName(FileName),900,900,0x0020),
GDI:pictdraw(Pic,pnt(0,0),rop_SrcCopy),
FileName=string::concat(Dir,"\\pt_pics\\chargeur.bmp"),
Pic=vpi::pictLoad(fileName(FileName),20,20,0x0020),
GDI:pictdraw(Pic,pnt(10,20),rop_SrcCopy).
ok
-
- VIP Member
- Posts: 204
- Joined: 16 Oct 2001 23:01

Code: Select all
clauses
onPaint(_Source, _Rectangle, GDI):-
Dir= directory::getCurrentDirectory(),
FileName1=string::concat(Dir,"\\pt_pics\\bdc.bmp"),
Pic1=vpi::pictLoad(FileName1,900,900,0x0020),
GDI:pictdraw(Pic1,pnt(0,0),rop_SrcCopy),
FileName2=string::concat(Dir,"\\pt_pics\\chargeur.bmp"),
Pic2=vpi::pictLoad(fileName(FileName2),20,20,0x0020),
GDI:pictdraw(Pic2,pnt(10,20),rop_SrcCopy).