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: Fastest way to drawcolor lines on TImage?

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





PostPosted: Thu Jun 26, 2003 7:19 am    Post subject: Re: Fastest way to drawcolor lines on TImage? Reply with quote



Bony wrote:

Quote:
Say, What is a TCanvas?

Type TCanvas in the editor, place the cursor on this word and call the
help with pressing <F1>.

Quote:
is it a component which i can put on my
form and draw on it?

It is a class that is used in many components. You can instantiate one
for yourself with:

TCanvas *Canvas = new TCanvas;
// use it
delete Canvas;

Quote:
or is it kind of a memory Bitmap?

Those two things cannot be compared.

Quote:
what is
the different between TCanvas and TImage? when will i use this
and when will i use that?

TImage and TForm have have a property Canvas. I.e:

TImage *Image;
TForm *Form;
TPaintBox *PaintBox;

Image->Canvas;
Image->Picture->Bitmap->Canvas;
Form->Canvas;
PaintBox->Canvas;


Quote:
How can i use 'LineScan' for drawing directly on a TImage which
is on my main form? (without using a memory Bitmap!) an
example even a small one will be great.

You mean BitMap->ScanLine ?

Examples can be fount easily if you do a google advanced newsgroups searc.
text: BitMap ScanLine' and so on
groups" *cppbuilder*

Quote:
How do i do the same to draw on directly the form's Canvas?

TCanvas has no ScanLine.

But if the canvas can be anywhere, as I said before make your drawing routines
in such a way that they expest a TCanvas as parameter and draw to that canvas.

Hans.

P.S. Could you and Chris please stop quoting and requoting complete messages ?


Back to top
Chris
Guest





PostPosted: Mon Jun 30, 2003 1:54 am    Post subject: Re: Fastest way to drawcolor lines on TImage? Reply with quote




Hi Hans

As I read it Bony wanted to know *which* was faster

1. Drawing directly on the Form's canvas?
OR
2. Drawing on TImage locate on the form?
OR
3. Drawing on TPicture locate on the form?


given that Bony said..
Quote:
i need to draw lot of random color lines on the
form as fast as possible.

my point was that **none** were fast, all were slow!
each one uses a canvas in the end


Quote:
From his other post He does not know what a canvas is so the point
was mute

Huh ?

This means that Bony is not really sure what a "canvas" is anyway so my
comments to him were meaningless (to him)

thats what is meant when you say a "point is mute"
it's another way of saying my words were wasted

Snip ;)

Back to top
Rolf Fankhauser
Guest





PostPosted: Fri Jun 02, 2006 6:15 am    Post subject: Re: Diagram Studio with Borland C++ Builder 6.0 Reply with quote



Hi Prabhu,

Did you see that there is a separate newsgroup for diagram studio under
87.106.40.200 port 119. Better to post your question there.

Kind regards,

Rolf


Prabhu S wrote:
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
Darren Dwyer
Guest





PostPosted: Sat Jun 03, 2006 3:15 pm    Post subject: Re: DirectX SDK 3D Empty Project examples... Reply with quote

try http://bcb-tools.com
- RAD DirectX for Borland C++ Builder.

It's Borland C++ Builder VCL compatible components...

- darren

"Jonathan Benedicto" <incorrect (AT) no (DOT) server> wrote in message
news:43c6697e$1 (AT) newsgroups (DOT) borland.com...
Quote:
Martin Golm wrote:
Example code? Help files? Where do I find these? Maybe I didn't
install them or something else is wrong, but I can't find D3D stuff.

It comes with the DXSDK. Look in the Doc (I think), and in
Examples\Direct3D.

Jonathan

http://jomitech.com/mtbcc32.shtml - Multi-threaded compilation for BCB
http://jomitech.com/forum - JomiTech Forums
Back to top
fei hongbin
Guest





PostPosted: Fri Jun 16, 2006 5:37 pm    Post subject: Re: TCanvas->TextOut - restore background Reply with quote

please try TCanvasText on http://www.codeidea.com


hongbin.fei
http://www.mytips123.com


"Hans Galema" <notused (AT) notused (DOT) nl>
??????:43e0727c$1 (AT) newsgroups (DOT) borland.com...
Quote:
Uli wrote:

how can I achieve, that the background, which was covered by a
TCanvas->TextOut method, is restored when a new text is written at the
same position.

Write the old text again using the background color.

I would not prefer just to fill the used TextRect with a specific colour,
because what will be, when the background is a structured one like a
picture?

Yes that is problematic. In that case write text with xor mode and write
again wit xor mode to erase.

I also don't want to use a TLabel component, because I have to realize
multiple text-outputs with an undefined amount. But the question is: how
does TLabel manage the background restauration when it is updated?

It will erase all using the backgroundcolor I think.

Hans.
Back to top
Darren Dwyer
Guest





PostPosted: Sun Jul 23, 2006 7:31 pm    Post subject: Re: How to find Graphic card performance Reply with quote

Hi, I've got some links to some benchmarking programs on my website...

http://bcb-tools.com/Welcome.htm#Demos

- darren

"Lars" <lgu (AT) promare (DOT) se> wrote in message
news:43e1d752$1 (AT) newsgroups (DOT) borland.com...
Quote:
Hi

Is there any smart way to find out performance (speed) of the installd
graphic card ?

I am building a SW and streem high resolution pictures.My application
depend
on a good Graphic performance and I want to send a warning to the user if
graphic performance is to bad.


Regards Lars

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.