Re: [ROOT] gVirtualX->PutImage and TCanvas

From: Thomas Bretz (Thomas_Bretz@ph.tum.de)
Date: Tue May 04 2004 - 15:13:05 MEST


Hi Rene,

yes, I know. I more or less graped the code I did from there. However I
need a fast and direct access without intermediate scaling steps or
similar. I want to make 100% sure, that I get exactly the bitmap I got
from my CCD on the screen and I want to render as direct as possible
into the bitmap data. Converting 8bit data into doubles and back does
for sure not fullfill the requirements.

Thanks anyhow,
Thomas.

On Tue, 4 May 2004, Rene Brun
wrote:

> Hi Thomas,
> 
> You will find below a short example illustrating the TASImage class.
> You can change teh filling of the buffer at your will.
> 
> Rene Brun
> 
> void test()
> {
>     gSystem->Load("libASImage");
>     TCanvas *c=new TCanvas;
>     double buf[100*100];
>     for (int j=0; j<100*100; j++)
>         buf[j]=j;
> 
>     TASImage *i = new TASImage("image",buf,100, 100);
>     i->Draw();
> }
> 
> 
> 
> Thomas Bretz wrote:
> > 
> > Hi,
> > 
> > with the (very simple) attached class I try to display a gray scaled
> > bitmap in a canvas. It doesn't work. Can somebody explain me, what I'm
> > doing wrong?
> > 
> > (I'm developing this class, because I need a really fast access to the
> > screen - 25fps - which I think I won't get with the big overgead of
> > TASImage)
> > 
> > Thanks in advance,
> > Thomas.
> > 
> >   --------------------------------------------------------------------------------
> >                  Name: MImage2.cc
> >    MImage2.cc    Type: unspecified type (APPLICATION/octet-stream)
> >              Encoding: BASE64
> > 
> >                 Name: MImage2.h
> >    MImage2.h    Type: unspecified type (APPLICATION/octet-stream)
> >             Encoding: BASE64
> > 
> >   --------------------------------------------------------------------------------
> > void test()
> > {
> >     TCanvas *c=new TCanvas;
> > 
> >     MImage2 *i = new MImage2(100, 100);
> > 
> >     byte buf[100*100];
> > 
> >     for (int j=0; j<100*100; j++)
> >         buf[j]=j;
> > 
> >     i->DrawImg(buf);
> >     i->Draw();
> > }
> 

-----
Würden Sie Windows 95 die Kontrolle eines AKWs überlassen? 
Hiroshima '45...! Tschernobyl '86...!! Windows 95...!!! 
Unix ist benutzerfreundlich - es ist nur etwas wählerisch..." (Walter Misar) 
Was sagt ein arbeitsloser Physiker zu einem Physiker mit Arbeit?
 - "Eine Currywurst mit Pommes bitte!" 



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:07 MET