BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Re: Out of resources in Draw

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Jacques Oberto
Guest





PostPosted: Fri Jul 25, 2003 8:28 am    Post subject: Re: Out of resources in Draw Reply with quote



Your TImage is getting way too big. There is no need to make a TImage
bigger than your screen because you can'y see it all at once anyway.
If you need to scroll you can play with the coordinates in
"Image1.Canvas.Draw (0,0,emf)" wich can take also negative values.
Hope it helps,

Jacques


"Ciarán Ó Duibhín" <ciaran (AT) oduibhin (DOT) freeserve.co.uk> a écrit dans le message
de news:3f2084f9 (AT) newsgroups (DOT) borland.com...
Quote:
Here's where I'm at in viewing an emf:

var emf: TMetaFile;
Image1: TImage;
scalepercent: integer;
FileName: string;
...
emf:=TMetaFile.Create;
emf.LoadFromFile (FileName);
scalepercent := ???;
emf.Height := emf.Height * scalepercent div 100;
emf.Width := emf.Width * scalepercent div 100;
Image1.Height := emf.height;
Image1.Width := emf.width;
Image1.Canvas.Draw (0,0,emf);
emf.Free

My problem: if I set "scalepercent" too high, I get "EOutOfResources" in
"Draw".

My question: can I work out beforehand the maximum acceptable value of
"scalepercent", by somehow comparing the amount of resources available
with
the amount that drawing the emf at the given size is going to consume?

And what is "resources" in this context? Memory?

Thanks for any ideas,
Ciarán Ó Duibhín.




Back to top
Joris
Guest





PostPosted: Sat Jul 26, 2003 9:52 pm    Post subject: Re: Out of resources in Draw Reply with quote



"Ciarán Ó Duibhín" <ciaran (AT) oduibhin (DOT) freeserve.co.uk> wrote

Quote:
the OS should do this kind of thing silently.

OS<>Imaging library. I'm sure Microsoft will agree with you, in time, though, that's how they
run everyone else out of bussiness.

Quote:
The other solution I thought of is to use hard disk as "virtual resources".

Single only solution for big image handling is proper tiling. Meaning, a raster object
should manage an array of tiles. Each tile should manage a limited array of pixels.
The raster object serves in hiding the tiling technology.



Joris



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.