Andy,
Check out the source code for the pixel_map class you use there. I bet it contains those functions. I don't use the pixel_map class myself, I'm more a WTL kind-a-guy, but if it works then I'm sure you're pretty much doing the right thing.
Dave
----- Original Message ----
From: AndyC <ACheetham@...>
To: vector-agg-general@...
Sent: Wednesday, March 1, 2006 2:50:56 PM
Subject: [AGG] Re: Newbie Question: Where to start.
Hi Dave,
Firstly thanks for responding to my post.
I am very pleased with my self at the minute as I have managed to get my
test application doing what I wanted it to do (draw some point, lines
and polygons onto the screen with some alpha blending).
In order to achieve this I have used the agg::pixel_map class from the
agg_win32_bmp.h file. I have done this as follows
agg::rendering_buffer rbuf;
agg::pixel_map pmap_window;
//Create the pixel_map
pmap_window.create(nWidth, nHeight, agg::org_color24);
//attach the pixel_map to the rendering buffer
rbuf.attach(pmap_window.buf(), nWidth, nHeight, -pmap_window.stride());
//Clear the background to white
rbuf.clear(255);
//Create the base_renderer with the agg::pixfmt_rgb24 object
pixfmt pixf(rbuf);
base_renderer rb(pixf);
//Draw some stuff to the base_renderer
DrawLines(rectClient, rb);
DrawPoints(rectClient, rb);
DrawPolygons(rectClient, rb);
//Display to result in the view
pmap_window.draw(pDC->m_hDC);
This seams to work very well, I am drawing about 1000 points, 100 lines
and about 50 polygons.
However I am a bit concerned that I have done this without looking up
any of the functions you specified, am I missing something or could it
be done a more efficient way?
Cheers
AndyC
dave@... wrote:
> Hello,
>
> The AGG library will draw to any surface, so what you'll need to do is
> override the OnPaint(?) and draw in an offscreen bitmap, then blit that
> bitmap to the GDI device context of your control.
>
> You can find an example in the platform specific source for win32,
> because that piece of code is a simple setup for a Windows app that
> paints to a GDI device context. You'll need to look up
> CreateCompatibleBitmap(), CreateDIBSection() and BitBlt() specifically.
>
> Sincerely,
>
> Dave
>
>
> ----- Original Message ----
> From: AndyC <ACheetham@...>
> To: vector-agg-general@...
> S ent: Wednesday, March 1, 2006 1:35:03 AM
> Subject: [AGG] Newbie Question: Where to start.
>
> Hi All,
>
> I have just come across the AGG Lib and I like to look of it very much.
> I would like to start using it within my graphical application as I
> think it will give it that professional look!!
>
> However I am struggling to get started. My application is a MFC Doc
> View based application which basically means that I need to use this AGG
> lib within a CView derived class.
>
> I have gone through the tutorials and I think I have at least some idea
> as to what is going on. Now where do I go from here? I have created a
> very simple app that uses the code in the tutorials to create a ppm
> file. How do I now go about drawing these images to the screen instead
> of a file?
>
> Any help is appreciated.
>
> Best regards
> Andy Cheetham
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by xPML, a groundbreaking scripting language
> that extends applications into web and mobile media. Attend the live webcast
> and join the prime developer group breaking into this new coding territory!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
> <http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642>
> _______________________________________________
> Vector-agg-general mailing list
> Vector-agg-general@...
> https://lists.sourceforge.net/lists/listinfo/vector-agg-general
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Vector-agg-general mailing list
Vector-agg-general@...
https://lists.sourceforge.net/lists/listinfo/vector-agg-general
|