Page 1 of 3

how to insert images on a form?

Posted: 15 Mar 2011 22:31
by marco62118
Good evening
how to insert images on a form?

Posted: 15 Mar 2011 22:32
by Steve Lympany
Hi,
use
GDI:pictdraw()
cheers
Steve

Posted: 16 Mar 2011 8:12
by marco62118
hello,
can you give me an exemple, i want to insert a file .bmp on my dialog box

Posted: 16 Mar 2011 8:30
by Steve Lympany
Hi,
http://wiki.visual-prolog.com/index.php?title=Main_Page

See Visual Prolog for Tyros, chapter 8

cheers
Steve

Posted: 16 Mar 2011 11:21
by Thomas Linder Puls
imageControl is very simple to use (but it is only in the Commercial Edition).

Re:

Posted: 21 Mar 2011 3:15
by mika0110
Steve Lympany wrote:Hi,
use
GDI:pictdraw()
cheers
Steve
where use it?(x.pro? or ....)

Posted: 21 Mar 2011 8:26
by Steve Lympany
Hi,
In your form:

Code: Select all

predicates     onPaint : drawWindow::paintResponder. clauses     onPaint(_Source, _Rectangle, GDI):-         Pic=get_your_picture(),         GDI:pictdraw(Pic,pnt(0,0),rop_SrcCopy),
The onPaint is called when the form is invalidate()ed. The onPaint predicate "skeleton" is inserted by the IDE - have you found that?

cheers
Steve

Re:

Posted: 23 Mar 2011 1:24
by mika0110
Steve Lympany wrote:Hi,
use
GDI:pictdraw()
cheers
Steve
Hi!
where i can store picture(path)? and how to use it with path?

help

Posted: 14 Apr 2014 11:19
by hicham
this is possible only if we want to insert on image in one form. But if we want 2 images in one form , how to do it?

Posted: 15 Apr 2014 7:25
by Tonton Luc

Posted: 18 Apr 2014 15:30
by hicham
how to do 2 images switching?

Posted: 20 Apr 2014 19:31
by Thomas Linder Puls
This code flips between the project icon and nothing:

Code: Select all

clauses     new(Parent):-         formWindow::new(Parent),         generatedInitialize(),         flipImage(true).   predicates     flipImage : (boolean Image). clauses     flipImage(S) :-         if true=S then             imageControl_ctl:setImageFile(@"..\taskwindow\ProjectIcon.ico")         else             imageControl_ctl:setNoImage()         end if,         delayCall(300, { :- flipImage(boolean::logicalNot(S)) }).

ok

Posted: 21 Apr 2014 9:15
by hicham
thanks , but i still have this error :

error c229 : Undeclared identifier 'setimagefile/1'


do i need to do sth?

thanks

Posted: 21 Apr 2014 10:07
by Thomas Linder Puls
In my example imageControl_ctl is assumed to be an imageControl.

However, the imageControl is only in the Commercial Edition. Do you use the Personal Edition?

Posted: 22 Apr 2014 8:50
by hicham
no i use commercial edition