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 »

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 »

Hi,
use
GDI:pictdraw()
cheers
Steve
marco62118
Posts: 9
Joined: 16 Feb 2011 19:21

Unread post by marco62118 »

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 »

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: 1178
Joined: 28 Feb 2000 0:01

Unread post by Thomas Linder Puls »

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 »

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 »

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 »

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 »

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 »

how to do 2 images switching?
ok
User avatar
Thomas Linder Puls
VIP Member
Posts: 1178
Joined: 28 Feb 2000 0:01

Unread post 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)) }).
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

ok

Unread post by hicham »

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: 1178
Joined: 28 Feb 2000 0:01

Unread post 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?
Regards Thomas Linder Puls
PDC
hicham
Active Member
Posts: 29
Joined: 3 Apr 2014 8:32

Unread post by hicham »

no i use commercial edition
ok
Post Reply