VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1[2]345678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 16:40:32 03/25/04 Thu
Author: Bjarne Winkler
Subject: Re: Assigning a List of TMetaFiles to a ImageScrollBox
In reply to: Ralph 's message, "Re: Assigning a List of TMetaFiles to a ImageScrollBox" on 05:28:41 03/25/04 Thu

Ralph,

The following code is working for me. I know this is the TDibGraphic not the TImageScrollBox. However the .Graphic in the TImageScrollBox is of the TDibGraphic type.

Graphic := TDibGraphic.Create;
Graphic.NewImage(2100, 2990, ifBlackWhite, nil, 300, 300);
Rect.Left := 0;
Rect.Top := 0;
Rect.Right := 2100;
Rect.Bottom := 2990;
Graphic.Canvas.Brush.Color := clWhite;
Graphic.Canvas.FillRect(Rect);

Hope this helps you.

>BTW: This is how I tried to do it:
>
>var
> mfOutput: TMetaFile;
> Rect: TRect;
> nCounter: Integer;
>
>for nCounter := 0 to (FList.Count - 1) do
>begin
> // ***************************************
> // go through the list page by page
> // ***************************************
> mfOutput := TMetaFile(FList.Items[nCounter]);
> mfOutput.MMWidth := GB_TIFWIDTH;
> mfOutput.MMHeight := GB_TIFHEIGHT;
>
> // ***************************************
> // prepare a new page in ImageScrollBox
> // THIS THROWS AN ERROR
> // ***************************************
> FImageScrollBox.Graphic.NewImage(2100, 2990,
>ifBlackWhite, nil, 300, 300);
>
> // ***************************************
> // fill the canvas with a white rectangle
> // ***************************************
> Rect.Left := 0;
> Rect.Top := 0;
> Rect.Right := 2100;
> Rect.Bottom := 2990;
> FImageScrollBox.Graphic.Canvas.Brush.Color :=
>clWhite;
> FImageScrollBox.Graphic.Canvas.FillRect(Rect);
>
> // ***************************************
> // draw the page on ScrollBox.Canvas
> // ***************************************
> FImageScrollBox.Graphic.Canvas.Draw(0, 0, mfOutput);
>end;

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.