PDA

View Full Version : Image Number in Piced.


Dave Byron
08 Nov 06, 09:51 AM
How do I get the image number ?? The reports list images by name with no number.
Do the numbers change as contents change page or once assigned stay that way.
What I need is single page and change the ImageNumber in the DrawImage procedure so can write 100 different images on single page in a slide show.


This from help file.
The DrawText procedure draws an image on the screen. This is not applicable for use with the Pascal Automation Controller.

dave

Darren
08 Nov 06, 09:37 PM
How do I get the image number ??
I was hoping that nobody would ever try to do this. You do love to push the envelope, don't you Dave ? ;)
The reports list images by name with no number.
From memory, they are numbered starting from 0 in the order they appear in the project summary. You could count your way through them to work out which is which.
Do the numbers change as contents change page or once assigned stay that way.
They will change. They are numbered in the order in which they are loaded.
What I need is single page and change the ImageNumber in the DrawImage procedure so can write 100 different images on single page in a slide show.
I think you can do it as follows :
1. Lets say you have 100 images, called "image1.bmp" to "image100.bmp"
2. Place all of the images you need on one page in the order you want to use them. This page should not be accessable from the other pages (so that it never gets seen).
3. If the index of the image you want is in a variable called ImageIndex (starting from 0), the code to display the image should be :

DrawImage(100, 200, "image1.bmp" + ImageIndex, false);

At compile time, it will resolve the "image1.bmp" tag to the number of that image (lets say it is 17). Since all of the other images are in order (image 17 to 116), then the above code will be equivalent to :

DrawImage(100, 200, 17 + ImageIndex, false);

Let us know if it works and we can add it to the FAQ.

Dave Byron
09 Nov 06, 06:57 AM
Darren,
Sure works in Piced, not tested in a Ctouch unit at moment.
Used this code without making a dummy page of images.

{ This module implements a Screen Saver of 104 photos.
The time-out on the home page is set to be the "photo" page.
Once the first photo page has been selected, the others will be displayed in sequence until a button is touched }

if ShowingPage("Photo") then
begin
repeat { loop indefinitely almost}
ClearScreen;
DrawImage(125, 80, "pic0000.jpg" + Photocnt, true);
if Photocnt = 103 then
Photocnt:=0
else
Photocnt:= Photocnt+1;
Delay("00:00:17");
until not ShowingPage("Photo");
end; { someone has pressed the screen }

Now for the Piced bug that does not write logic only referenced images to unit or backup file (or has it been fixed), but noticed without the dummy page the Project Summary Report shows all the images.

c:\clipsal\piced\projects\wheeler\pic0000.jpg
c:\clipsal\piced\projects\wheeler\pic0001.jpg
c:\clipsal\piced\projects\wheeler\pic0002.jpg
c:\clipsal\piced\projects\wheeler\pic0003.jpg
c:\clipsal\piced\projects\wheeler\pic0004.jpg
c:\clipsal\piced\projects\wheeler\pic0005.jpg
c:\clipsal\piced\projects\wheeler\pic0006.jpg
c:\clipsal\piced\projects\wheeler\pic0007.jpg

Can you test on a unit there?.
Also have look at the help file for "DrawImage" talks about drawtext - typo

Dave
The Envelope Pusher

Darren
09 Nov 06, 09:35 AM
Sure works in Piced, not tested in a Ctouch unit at moment.
Good.

Now for the Piced bug that does not write logic only referenced images to unit or backup file (or has it been fixed), but noticed without the dummy page the Project Summary Report shows all the images.
In this particular case, it will be necessary to use all of the images in the project (not logic) so that they will get loaded. Images which are only referenced from logic do get loaded and archived, but in this case, you aren't actually referring to each image in the code. Only the first one "pic0000.jpg" is being specifically referenced.

Also have look at the help file for "DrawImage" talks about drawtext - typo
Fixed.

The Envelope Pusher
I like your new designation :)

Dave Byron
09 Nov 06, 10:14 AM
New envolope, Graph Transition in DrawImage
Need an extra opion to have the above effect without having to load a blank page and then switch to get a page transition effect - just stay on same page and change image.
Piced version 9 i think ??

Got a work around, added
ClearScreen;
ShowPage("Photo");
DrawImage(0, 0, "pic0000.jpg" + Photocnt, true);

thinks its a differnet page and does the transition.



dave

Darren
10 Nov 06, 05:50 PM
Very clever.

ICS-GS
10 Nov 06, 09:05 PM
Dave, you the man!. Have an application where the client wants something like this. Looked at it but did not have the time to work out the finer points...yet.

Where do i send the A3 envelope ? (you deserve the upgrade):cool:

Dave Byron
11 Nov 06, 04:27 AM
ICS-GS
Put in small change for Darren he has to do the help file write up.

dave

ICS-GS
13 Nov 06, 10:22 AM
i guess... i think i would rather bang my head against a wall than have to write comprehensive help files.

Phil.H
24 Nov 06, 06:31 AM
i guess... i think i would rather bang my head against a wall than have to write comprehensive help files.

Our much loved Darren is a machine when it comes to writing help and FAQ files... ;)