Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 10 JAN 2001 03:47:02PM Dave Harmacek wrote:

I'd like to display a TIFF file on a form so that the user can use scroll bars to view anything out of view. I've tried both a BITMAP and a LIST BOX control, setting the "BITMAP" property to the full pathname to the .tif file. I get only a little window icon. Can this be done?

Secondly I'd like to send the image to a laser printer. Can OI do this directly?

Thanks


At 10 JAN 2001 05:37PM WinWin/Revelation Technical Support wrote:

Dave-

It works for both. Setting the Bitmsap property is correct- does path and filename follow 8.3 rules?

Bitmaps can be printed out directly via the reporter.

Mike Ruane


At 10 JAN 2001 05:40PM WinWin/Revelation Support wrote:

Dave:

Also Check out this thread about using images

and this thread about printing them

Hope this helps.

Bob

At 11 JAN 2001 04:29AM Oystein Reigem wrote:

Mike,

It works for both

Do you really mean one can use a list box control instead of a bitmap control to display images? Well, I tried. In a (hierarchical) list box control one can have bitmaps at the head of each item. So I made a hierarchical list box with a 1 image bitmap, and a single item of data (1-1:test). I only got small images to display.

Btw - I didn't try to do it programmatically. Perhaps larger images would display then???

It would have been nice if it worked. One would have got a bitmap control with scroll bars with no programming.

Btw - only the horizontal scrolling would have worked. When you scroll a list box vertically it will scroll whole items (lines), and since the image belongs to the line one couldn't have scrolled just a part of the image's height.

- Oystein -


At 11 JAN 2001 04:33AM Oystein Reigem wrote:

Dave,

TIFFs come in many flavours. I know next to nothing about the TIFF format, but from experience with other formats (JPEG, GIF) I know OI (or the Imageman library it uses) can't always display all flavours. You might want to convert your TIFF to a different flavour and try again. Or let somebody else try that for you.

- Oystein -

Øystein Reigem,

Humanities Information Technologies,

Allégt 27,

N-5007 Bergen,

Norway.

Tel: +47 55 58 32 42.

Fax: +47 55 58 94 70.

[email protected]

Home tel/fax: +47 56 14 06 11.


At 11 JAN 2001 11:42AM Dave Harmacek wrote:

Pathname is 8.3 since on Netware 3.12 and main application still resides in ARev.

My code looked like foo=set_property(@window:".LISTBOX_1","BITMAP", "f:\scans\123284c.tif")

It showed only then the image I found as DEFAULT.ICO.

I can't use Reporter for the anticipated application because each page will be of a different format/ font.

Dave


At 11 JAN 2001 02:12PM Oystein Reigem wrote:

Dave,

Why don't you use a BITMAP control instead? Less pitfalls.

- Oystein -


At 13 JAN 2001 10:56AM Dave Harmacek wrote:

It is a .tif because it is an image of a full-page paper document, which won't be run thru OCR. I expect the LISTBOX to be able to provide vertical and horizontal scroll bars so the user can read the entire document in full size.

The BITMAP control appears to be best for icons and small pictures, no?


At 15 JAN 2001 05:38AM Oystein Reigem wrote:

Dave,

Which control(s) to use

When I said BITMAP I didn't mean the file format. I tried to suggest you use a BITMAP control instead of a LISTBOX control. I din't think a LISTBOX was meant for images as such. It's meant for text lines, with an optional small image preceeding each line. I haven't had much success with displaying other than small images in a list box.

But I might be wrong. For all I know you might get lucky and manage to display your image in a LISTBOX. But - as I tried to tell you in a different response - you won't be able to do a proper vertical scroll. Horizontal scroll might work, but vertically a LISTBOX control can only scroll one line at a time. And your image will fill one whole line.

So I think you have to use a BITMAP control. BITMAP controls can show large images.

But the BITMAP control has no scroll bars. You'll have to add a couple of scrollbar controls, and you have to do some programming.

It's not difficult to get a scroll bar control to scroll an image in a BITMAP control. Scrolling is done by manipulating the IMAGEOFFSET property. E.g, do the following:

Make a form with

- one BITMAP control, named "BITMAP"

- one vertical scroll bar, named "VSCROLL"

- one horizontal scroll bar, named "HSCROLL".

Set the BITMAP control to Clip, not Resize. Set a Bitmap entity if you like (the default image will do). Place and size the scroll bars along the BITMAP control's right side and bottom.

Put the following in the VSCROLL handler's VSCROLL user event:

offset=Get_Property( @Window : ".BITMAP", "IMAGEOFFSET" )

offset=Value

oldoffset=Set_Property( @Window : ".BITMAP", "IMAGEOFFSET", offset )

RETURN 0

Put the following in the HSCROLL handler's HSCROLL user event:

offset=Get_Property( @Window : ".BITMAP", "IMAGEOFFSET" )

offset=Value

oldoffset=Set_Property( @Window : ".BITMAP", "IMAGEOFFSET", offset )

RETURN 0

Scroll bars are by default set up to scroll in steps of 1 from a minimum of 0 to a maximum of 100. This means that the Value you get in your user events ranges from 0 to 100. And the way I've programmed in this example means you can scroll 1 pixel at a time to a maximum of 100 pixels.

If your image is let's say 500 pixels high, you could e.g set your vertical scroll bar to run from 0 to 450 in steps of 50.

But have you got more than one image you want to display in the same window - images of different sizes? Then the difficult part could be to know how large the image is - width and height in pixels. If the programming for the scrolling doesn't know the image size it won't know how far it's allowed to scroll. You might have to go outside OpenInsight for a function that can decide the size of an image in an image file. (Don Bakke supplied me with such a finction for BMP files, but I don't know about TIFFs.)

Alternatives

As an alternative to displaying images in a BITMAP control in an OI form you could use an external image viewer, i.e, a different program to show the images. That's mostly what I've done in my own apps.

(It's also possible to display images in OI forms by using Windows GDI functions. Next time I need to display images in an OI form myself, I might do that, so I can get better image quality for 24 bit images.)

File format

I don't quite get why you have to use TIFF. When the document's scanned you might be able to save it in other formats too.

But there's nothing wrong with TIFF in itself. I'm just suggesting your TIFF is a flavour (a variant of the format) that OI can't display. E.g, with the JPEG format OI can display images in some flavours but not all. It can't display so-called progessive JPEGs (a flavour sometimes used on the web, where the image appears in a blinder-like fashion). It might be similar problems with flavours of TIFF. But first try to display your TIFF in a BITMAP control and then take it from there.

If you mail me the image I can do some experiments here.

(Btw - I mentioned OI doesn't display 24-bit images at optimal quality. So if your image is saved in full colour, and the original document is in black and white save it again in grayscale. But I don't think this has anything to do with your problems.)

- Oystein -

Øystein Reigem,

Humanities Information Technologies,

Allégt 27,

N-5007 Bergen,

Norway.

Tel: +47 55 58 32 42.

Fax: +47 55 58 94 70.

[email protected]

Home tel/fax: +47 56 14 06 11.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/e8f5b38abb3b43ab852569d000722b7c.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1