Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Changes to Graphics.pas in D6

0 views
Skip to first unread message

Colin Wilson

unread,
Jun 28, 2001, 6:25:14 AM6/28/01
to
Here's a list of changes made to graphics.pas I gleaned from comparing
the D5 and D6 source:

* TGraphic.Create is now 'public' instead of 'protected'. This fixes
a bug where the wrong constructor got called in situations like this:

procedure TForm1.Button1Click(Sender: TObject);
var
cls : TGraphicClass;
gr : TGraphic;
begin
cls := TGifImage;
gr := cls.Create // Called TObject.Create in D5,
// Calls TGifImage.Create in D6
end;

* TGraphic is now derived from TInterfacedPersistent, and supports
IStreamPersist

* There's a new HandleAllocated function in things derived from
TGraphicsObject (eg. pens, brushes). Also TBitmap, TMetafile, TIcon
also have this new function.

* Four new colors have been added -

clMoneyGreen = TColor($C0DCC0);
clSkyBlue = TColor($F0CAA6);
clCream = TColor($F0FBFF);
clMedGray = TColor($A4A0A0);

* TPicture now has LoadFromStream / SaveToStream - but beware!
Internally they call Bitmap.LoadFromStream - not
Graphic.LoadFromStream. This is probably a new D6 bug, but it's hard
to tell as the new Load/SaveToStream functions aren't in the help for
TPicture...

* Bug fix in internal CopyBitmap function for pf1Bit images

* RLE bitmap handling has been tarted up.

* 'Dormant' now compacts the saved image better?

That's about it...

Colin
e-mail :co...@wilsonc.demon.co.uk
web: http://www.wilsonc.demon.co.uk/delphi.htm

Thérèse Hanquet

unread,
Jun 28, 2001, 6:53:23 AM6/28/01
to
Hi Colin,

Thanks for the list - interesting when you hesitate about upgrading.

> clMedGray = TColor($A4A0A0);

I already wondered why both clGray and clDkGray had the same value
(TColor($808080)).
Now I wonder why this clMedGray is not at mid-way between those and clLtGray
(TColor($C0C0C0)), and also why it's not a "real" gray (with R=G=B).
Is it a special Windows 2K color?

Thérèse

Joris Van Damme

unread,
Jun 28, 2001, 10:02:38 AM6/28/01
to
Colin Wilson wrote:
> Here's a list of changes made to graphics.pas I gleaned from comparing
> the D5 and D6 source:

Thanks!

Joris

Earl F. Glynn

unread,
Jun 28, 2001, 10:52:07 AM6/28/01
to
"Thérèse Hanquet" <therese...@skynet.be> wrote in message
news:3b3b0c3e$2_1@dnews...

> Hi Colin,
>
> Thanks for the list

Ditto. Thanks, Colin.

The four "new" colors in D6 have been defined by Microsoft at least since
Windows 3.1 days, but there still seems to be some confusion about exactly
what the RGB values are or what the names should be.

In D6: clMoneyGree, clSkyBlule, clCream, clMedGray

From www.compuphase.com/palette.htm:
pastel green, pastel blue, soft white, medium gray

Microsoft Systems Journal, Sept. 91, p. 119:
money green, sky blue, cream, light grey

RxLib uses different definitions for clSkyBlue and clCream than the values
given by Microsoft:
RxLib SkyBlue is TColor($FFFBF0)
RxLib Cream is TColor($A6CAF0)

> > clMedGray = TColor($A4A0A0);
>
> I already wondered why both clGray and clDkGray had the same value
> (TColor($808080)).
> Now I wonder why this clMedGray is not at mid-way between those and
clLtGray

I'm only guessing, but it may have something to do with gamma correction
and linear "perception".

> (TColor($C0C0C0)), and also why it's not a "real" gray (with R=G=B).

Good question.

> Is it a special Windows 2K color?

Microsoft's "light gray", called clMedGray in D6, was defined in Windows 3.1
days in the MSJ article cited above.

I try to collect information about all of this under "System Colors" at
http://homepages.borland.com/efg2lab/Library/Delphi/Graphics/Color.htm
--
efg -- Earl F. Glynn, Overland Park, KS USA
efg's Computer Lab Mirror: http://homepages.borland.com/efg2lab

0 new messages