home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!ornl!utkcs2!darwin.sura.net!spool.mu.edu!yale.edu!ira.uka.de!math.fu-berlin.de!news.netmbx.de!Germany.EU.net!mcsun!fuug!compart!jarmo.aho
- From: jarmo.aho@compart.fi (Jarmo Aho)
- Newsgroups: comp.lang.pascal
- Subject: getimage
- Message-ID: <4161.1250.uupcb@compart.fi>
- Date: 12 Dec 92 10:55:00 GMT
- Distribution: world
- Organization: ComPart BBS, Helsinki-Finland, +358 0 506 3329 (14 lines V.32bis)
- Reply-To: jarmo.aho@compart.fi (Jarmo Aho)
- Lines: 26
-
-
- DJ> I am busy with a small game woith some simple graphics.
- DJ> I found out what the format is of a (TP) getimage BMP but I don't
- DJ> know what the meaning is of the last word. Could anyone tell me ?
-
-
- If yoy are talking about 16 color mode, then that last word is
- meaningless. I have found that ImageSize doesn't compute imagesize
- quite correctly. It gives two bytes (that last word) too much.
- That is not very serious, but in 256 color graphics mode it's
- worse. For example ImageSize(0,0,30,30) gives 998. Correct value
- is 965.
-
- This should work:
-
- function ImageSize(x1, y1, x2, y2 : integer) : longint;
- begin
- if GetMaxColor = 255 then
- ImageSize := longint(Abs(x2-x1)+1) * longint(Abs(y2-y1)+1) + 4
- else if GetMaxColor = 15 then
- ImageSize := ( ( (Abs(x2-x1)+1) + 7) shr 3) * 4 * (Abs(y2-y1)+1) + 4
- else
- ImageSize := Graph.ImageSize(x1,y1,x2,y2);
- end;
-
-
-