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 

Diagram Studio with Borland C++ Builder 6.0

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Graphics)
View previous topic :: View next topic  
Author Message
Prabhu S
Guest





PostPosted: Thu Dec 22, 2005 9:18 am    Post subject: Diagram Studio with Borland C++ Builder 6.0 Reply with quote




Hi,

I have installed Diagram Studio for Borland C++ Builder 6.0 from TMS Software.

Diagram Studio gives an Object called atDiagram1 where we can draw flow chart Blocks, Electric Blocks, Lines, Arrow Blocks etc...

We can also load a Bitmap Image as a Background Image for atDiagram1.

The Code which I used to Load the Bitmap is as follows,

CODE1:
======
Graphics::TBitmap *BrushBmp = new Graphics::TBitmap;

//Creation of Canvas Over the atDiagram1 Display area
TCanvas *BackgroundCanvas = CfrmNCD->atDiagram1->Background->Bitmap->Canvas;

// Load the Image as Background Image for NCD Window
try
{
BrushBmp->LoadFromFile(astrPathName);
CfrmNCD->atDiagram1->Background->Visible = true;
CfrmNCD->atDiagram1->Background->Bitmap->Width = Screen->DesktopWidth;
CfrmNCD->atDiagram1->Background->Bitmap->Height = Screen->DesktopHeight;
BackgroundCanvas->Brush->Bitmap = BrushBmp;
TRect DrawRect;
DrawRect = Screen->DesktopRect;
DrawRect.Bottom = DrawRect.Bottom - 90;
BackgroundCanvas->StretchDraw(DrawRect,BrushBmp);
}
catch(EInOutError & e)
{
delete BrushBmp;
return false;
}
catch (Exception &exception)
{
delete BrushBmp;
return false;
}
delete BrushBmp;


I can also use the following code to Load the Image as Background for atDiagram1,

CODE 2:
=======

atDiagram1->Background->Visible = true;
atDiagram1->Background->Bitmap->LoadFromFile(astrPathName);

But there is no property to set for Stretching the Image.
There is a Property where we can choose only one the following Options,

a. Tiled
b. Fixed

There is no option like Stretch for Stretching the Image.

I asked TMS Software. They Replied that there is no such Option.

So I Used CODE 1 where it creates a canvas and draws the Image on canvas after stretching it.

The Problem is,

If I Use CODE1:
===============

When Backgound Image is not Present and If I move the Blocks displayed over the atDiagram1, there is NO Memory Leak.

When I Load the Background Image, and If I move the Blocks displayed over the atDiagram1, there is a huge Memory Leak.

If I use CODE 2:
===============

When I Load the Background Image and If I Move the Blocks displayed on atDiagram1, there is no huge Memory Leak.

Why It happens ?

Is there any way to stretch the Image before loading ?

Thank you.

Regards,
Prabhu S


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (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.