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 

TImage compression and drawings

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Harish
Guest





PostPosted: Sat Sep 02, 2006 2:04 pm    Post subject: TImage compression and drawings Reply with quote



I am dynamically loading bitmap pictures on a TImage control. Larger images are compressed by setting the property TImage->Proportional = true. Afterwards I am drawing polygons on the image canvas. The problem is, when the images are large, the polygons are also getting compressed. I do not want this to happen. The image should get compressed, but not the drawings. Could you please suggest some solutions?
Back to top
JD
Guest





PostPosted: Sat Sep 02, 2006 6:31 pm    Post subject: Re: TImage compression and drawings Reply with quote



"Harish" <cshavadhani (AT) yahoo (DOT) com> wrote:
Quote:


Please wrap your lines when you post. Your editor may visually
wrap them for you but you need to enter a hard return at the
end of each line. If you're using a Reader, then you need to
set it line length.

Quote:
I am dynamically loading bitmap pictures on a TImage control.
Larger images are compressed by setting the property
TImage->Proportional = true. Afterwards I am drawing
polygons on the image canvas. The problem is, when the
images are large, the polygons are also getting compressed.

It's unclear to me what you mean - exactly. However, I do
understand that you have a scaling issue with the glyph and
the polygons.

The only thing that I can suggest at this point is to not use
the TImage. Use a TBitmap instead and assume responsibility
for painting it.

The easiest way to paint the bitmap is to use a TPaintBox
with an OnPaint event where all you do is call it's Canvas's
StretchDraw method to scale the bitmap to the desired size
and location. Note that all drawing done to the bitmap's
Canvas would be static while drawing to the TPaintBox's
Canvas would need to be done every time the control is
repainted.

If you add a TScrollBox and place the TPaintBox inside it,
then you wouldn't need to scale it at all because the
TScrollBox will allow the user to scroll the TBitmap.

~ JD
Back to top
Bruce Larrabee
Guest





PostPosted: Sun Sep 03, 2006 4:44 pm    Post subject: Re: TImage compression and drawings Reply with quote



Hi,

Another (similar) approach is to use two identical TImage surfaces
with the polygons being drawn an the surface of the TImage on 'top'
(in 'Z' order). This TImage surface being otherwise transparent.

JD's suggestion probably covers the most likely needs, and has
advantages, it depends on what you really need to do...

You can pile these things up in stacks for that matter but it can
become ah, more complex...

Bruce Larrabee
Back to top
Harish
Guest





PostPosted: Mon Sep 04, 2006 8:10 am    Post subject: Re: TImage compression and drawings Reply with quote

This solution worked.
Thank you very much.
-Harish
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) 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.