Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 18 AUG 1999 02:29:24PM Mark Glicksman wrote:

What are the possibilities for doing the following?

1. Causing a bitmap resize only if it is too big to fit the control. If smaller than the control, it stays at its original size. This would be extremely useful for displaying photographs.

2. Providing scroll bars for a bitmap control.

3. Printing a bitmap.

Thanks,

[email protected]

BG-Map Botanical Garden Mapping System


At 19 AUG 1999 09:46AM Eric Emu wrote:

You could write a subroutine prune.heavily() to make all images 1 pixel by 1 pixel. Because they are pictures of plants they will eventually grow back over the entire screen, anyway. The picture of my lassiandra is a case in point - they love a good prune. As for the weigela… don't mention the weigela…..

In RBASIC…..

OSOPEN 'BITMAP.BMP' TO BMP THEN
  OSBREAD HEADER FROM BMP AT 0 LENGTH 32
  IF HEADER1,2=BM' THEN
    X=SEQ(HEADER19,1)
    X=X + (256 * SEQ(HEADER20,1))
    X=X + (4096 * SEQ(HEADER21,1))
    X=X + (65536 * SEQ(HEADER22,1))
    Y=SEQ(HEADER23,1)
    Y=Y + (256 * SEQ(HEADER24,1))
    Y=Y + (4096 * SEQ(HEADER25,1))
    Y=Y + (65536 * SEQ(HEADER26,1))
    CALL MSG(' Bmp dimensions are ':X:' wide ':Y:' high','','','')
  END ELSE
    CALL MSG('Error reading format of *.bmp file')
  END
END

Then for some GIFS….

OSOPEN 'MYFILE.GIF' TO G THEN
  OSBREAD GIF FROM G AT 0 LENGTH 20 THEN
    IF GIF1,4=GIF8" THEN
      WIDTH=SEQ(GIF8,1) * 256 + SEQ(GIF7,1)
      HEIGHT=SEQ(GIF10,1) * 256 + SEQ(GIF9,1)
    END
  END
END

Bitmaps are X,Y grids of pixels, so it is not too hard, given the dimensions, to work out how many pixels there might be, and to use a HP laserjet in dot mode to represent each point in the image direct from the file.

The Doctor Dobbs journal on CD ROM has these file format specifications and many more. Just don't ask for *.jpg dimensions….

Eric


At 19 AUG 1999 09:57AM Don Bakke wrote:

Hi Mark,

We have done all three of these items:

1. Causing a bitmap resize only if it is too big to fit the control. If smaller than the control, it stays at its original size. This would be extremely useful for displaying photographs.

We do this in one of our systems that stores signatures. What you need is the logic to extract the pixel dimensions of the BMP file. I submitted a routine to do just that a year ago. Here is the link to it.

2. Providing scroll bars for a bitmap control.

All you need to do is to put your own Vertical and Horizontal scroll bars on the edges of your bitmap control. If the image size is equal to or smaller than the bitmap control then make them invisible. Most likely, however, you won't use scroll bars if you are resizing the bitmap control since you should be able to see the whole picture (unless you have really large bitmaps.) We have, however, created a screen that uses scroll bars exclusively rather than resize the bitmap control. You have to constantly play with the max/min values to make the scroll bar work best on the total height/width of your bitmap relative to the height/width of your control. You then have to play with the IMAGEORIGIN property to "shift" the bitmap to make it look as if the scrollbars are moving it around.

3. Printing a bitmap.

The Revelation Reporter can do this. The only other way I know how to print bitmaps from within OpenInsight is to use the OIPI.

[email protected]

SRP Computer Solutions


At 19 AUG 1999 09:59AM Don Bakke wrote:

From experience: if you don't OSClose your files you will get a Sharing Violation error the moment you try to set the property of your BITMAP control with the image you just parsed for information.

[email protected]

SRP Computer Solutions


At 19 AUG 1999 10:34AM Eric Emu wrote:

Thanks Don,

Emus are not aware of such subtleties. I didn't realise you had posted the solution code a year ago. At least your code doesn't look as bad as some of my code from last year….come to think of it, my code looks worse this year…..

Eric


At 19 AUG 1999 02:28PM Mark Glicksman wrote:

Eric and Don,

Thanks for the suggestions in references. They look very useful indeed.

Best wishes,

[email protected]

BG-Map Botanical Garden Mapping System

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/06d00897b2282814852567d1006591db.txt
  • Last modified: 2024/01/04 21:00
  • by 127.0.0.1