Search found 56 matches

by Steve Lympany
12 Apr 2012 14:13
Forum: Visual Prolog
Topic: Form Menu Code Expert
Replies: 14
Views: 14887

Hi,
Yes, you're right. Right clicking shows a popup menu for forms+dialogs with "code expert" greyed out.

I'd not really noticed. I'd managed to work without it without problems.

cheers
s
by Steve Lympany
11 Apr 2012 17:20
Forum: Visual Prolog
Topic: Form Menu Code Expert
Replies: 14
Views: 14887

Hi, You are almost there. If you have menu items "fred" and "joe" in the associated menu: predicates onMenuItem : window::menuItemListener. clauses onMenuItem(_Source, resourceIdentifiers::id_fred):-!,do_fred(). onMenuItem(_Source, resourceIdentifiers::id_joe):-!,do_joe(). onMenu...
by Steve Lympany
13 Jul 2011 8:49
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Hi Paul,
Yes, I've tried that, and didn't get very far (after several hours). Hence the above idea,just to change the size.

Many thanks for the ideas. I'll continue to play and will post a solution if I am successful.

cheers
steve
by Steve Lympany
12 Jul 2011 7:25
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Hi Paul, I haven't tried. I want to open a jpg and use vpi::picture (which only reads a bmp). The following works: predicates jpgToBmp :(string JpgFile). clauses jpgToBmp(JpgFile):- Image=image::createFromFile(JpgFile),%or bitmap:: gdiplus::imageCodecInfo(BMPId, _, _, _, _, _, _, _, _, _, _, _, _) =...
by Steve Lympany
11 Jul 2011 14:31
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Hello again, Still fiddling around with this. The following code is supposed to convert a jpg to a bitmap. The reason I do it this way is that if I do it without any sizing, a 6Mb JPG converts to a 200Mb BMP. Unfortunately, the code below only produces a black bitmap. Any ideas? predicates jpgToBmp ...
by Steve Lympany
29 Jun 2011 18:05
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Hi,
Many thanks for your thoughts.
Tonton, I assume you mean grab the picture from a window/form/screen....? It's an idea, but I think I (end-users) will lose resolution.

cheers
Steve
by Steve Lympany
27 Jun 2011 18:42
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Hi Tonton,
Thanks, yes, I saw those, but they don't really help. I want to work with a vpi::picture, but load a jpg.

cheers
steve
by Steve Lympany
27 Jun 2011 9:33
Forum: Visual Prolog
Topic: Working with jpg files
Replies: 12
Views: 12768

Working with jpg files

Hi, Is there a better way of doing the following, eg using iStream_native, rather than working on disk? predicates jpeg_picture:(string JpegFile)->picture. clauses jpeg_picture(JPG)=Picture:- Workfile="C:\\a.bmp", Bitmap=bitmap::createFromFile(JPG), gdiplus::imageCodecInfo(JpegId, _, _, _,...
by Steve Lympany
29 May 2011 21:09
Forum: Visual Prolog Tips & Samples
Topic: drawHTMLinRect
Replies: 5
Views: 21195

Hi, Here is an update - DLL version 1.0.0.6. I've added a bit of extra functionality. http://www.acsumama.com/vip/drawhtml/index.htm There is a movie (you may have to wait 20 seconds for it to load) so you immediately can see what it does: http://www.acsumama.com/vip/drawhtml/drawhtmlmovie.htm Steve
by Steve Lympany
12 May 2011 14:27
Forum: Visual Prolog Tips & Samples
Topic: Another tokenise
Replies: 0
Views: 10507

Another tokenise

Maybe this is useful to someone. Jump to the bottom to see examples. class predicates mytokenise:(string)->string*. clauses mytokenise(STR)=L:- Rev=mytokprivate(STR,[""]), L=list::reverse(Rev). class facts zz_splitby_items:string*:=[]. zz_previous_char_was_a_split:boolean:=false. class pre...
by Steve Lympany
8 May 2011 18:52
Forum: Visual Prolog Tips & Samples
Topic: Catching maximize and minimize events
Replies: 0
Views: 9405

Catching maximize and minimize events

clauses new(Parent):- formWindow::new(Parent), generatedInitialize(), addNativeMessageHandler(nativeMessageHandler). predicates nativeMessageHandler : window::nativeMessageHandler. clauses nativeMessageHandler(_Source, gui_native::wm_size, _WParam, 47908248)= defaultNativeHandling :-!, vpiCommonDia...
by Steve Lympany
21 Mar 2011 8:26
Forum: Visual Prolog
Topic: how to insert images on a form?
Replies: 32
Views: 26036

Hi, In your form: 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 - h...
by Steve Lympany
16 Mar 2011 8:30
Forum: Visual Prolog
Topic: how to insert images on a form?
Replies: 32
Views: 26036

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

See Visual Prolog for Tyros, chapter 8

cheers
Steve
by Steve Lympany
15 Mar 2011 22:32
Forum: Visual Prolog
Topic: how to insert images on a form?
Replies: 32
Views: 26036

Hi,
use
GDI:pictdraw()
cheers
Steve