how to insert images on a form?

Discussions related to Visual Prolog
marco62118
Posts: 9
Joined: 16 Feb 2011 19:21

how to insert images on a form?

Unread post by marco62118 » 15 Mar 2011 22:31

Good evening
how to insert images on a form?
Novice, very novice in Visual Prolog and even poorer in English

Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 15 Mar 2011 22:32

Hi,
use
GDI:pictdraw()
cheers
Steve

marco62118
Posts: 9
Joined: 16 Feb 2011 19:21

Unread post by marco62118 » 16 Mar 2011 8:12

hello,
can you give me an exemple, i want to insert a file .bmp on my dialog box
Novice, very novice in Visual Prolog and even poorer in English

Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 16 Mar 2011 8:30

Hi,
http://wiki.visual-prolog.com/index.php?title=Main_Page

See Visual Prolog for Tyros, chapter 8

cheers
Steve

User avatar
Thomas Linder Puls
VIP Member
Posts: 1175
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 16 Mar 2011 11:21

imageControl is very simple to use (but it is only in the Commercial Edition).
Regards Thomas Linder Puls
PDC

mika0110
Posts: 2
Joined: 8 Mar 2011 15:14

Re:

Unread post by mika0110 » 21 Mar 2011 3:15

Steve Lympany wrote:Hi,
use
GDI:pictdraw()
cheers
Steve
where use it?(x.pro? or ....)

Steve Lympany
VIP Member
Posts: 56
Joined: 31 Mar 2001 23:01

Unread post by Steve Lympany » 21 Mar 2011 8:26

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

mika0110
Posts: 2
Joined: 8 Mar 2011 15:14

Re:

Unread post by mika0110 » 23 Mar 2011 1:24

Steve Lympany wrote:Hi,
use
GDI:pictdraw()
cheers
Steve
Hi!
where i can store picture(path)? and how to use it with path?

hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

help

Unread post by hicham » 14 Apr 2014 11:19

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?
ok


hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham » 18 Apr 2014 15:30

how to do 2 images switching?
ok

User avatar
Thomas Linder Puls
VIP Member
Posts: 1175
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 20 Apr 2014 19:31

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)) }).
Regards Thomas Linder Puls
PDC

hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

ok

Unread post by hicham » 21 Apr 2014 9:15

thanks , but i still have this error :

error c229 : Undeclared identifier 'setimagefile/1'


do i need to do sth?

thanks
ok

User avatar
Thomas Linder Puls
VIP Member
Posts: 1175
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls » 21 Apr 2014 10:07

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?
Regards Thomas Linder Puls
PDC

hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham » 22 Apr 2014 8:50

no i use commercial edition
ok

Post Reply