Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - imaging performance

 
 
Old 01-10-2006   #1 (permalink)
StefanT


 
 

imaging performance

Hello,

I have some question about the image performance, I have a project where I
have to create images very fast, at this moment I use GDI+ to do that, also I
tried to use DirectX to create images but it seems that GPUs are not designed
for reading, to copy an image from a Surface is very slow.

My question is how is the WPF performace compared with GDI+, for image
creation the power of GPU is used ?

Best regards,
Stefan

My System SpecsSystem Spec
Old 01-10-2006   #2 (permalink)
robertwl@nospam.microsoft.com


 
 

re: imaging performance

Hi Stefan,

The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.

What kind of performance metrics are you interested in looking at?

Robert.

-----Original Message-----
From: stefan_tabaranu
Posted At: Thursday, January 05, 2006 6:06 AM
Posted To: microsoft.public.windows.developer.winfx.avalon
Conversation: imaging performance
Subject: imaging performance


Hello,

I have some question about the image performance, I have a project where I
have to create images very fast, at this moment I use GDI+ to do that, also I
tried to use DirectX to create images but it seems that GPUs are not designed
for reading, to copy an image from a Surface is very slow.

My question is how is the WPF performace compared with GDI+, for image
creation the power of GPU is used ?

Best regards,
Stefan
My System SpecsSystem Spec
Old 01-10-2006   #3 (permalink)
StefanT


 
 

re: imaging performance

In my test I only draw something on the image and after that I save the image
on the hard drive like this:

while (true)
{

gfx.DrawString(new Guid().ToString(), font, new
SolidBrush(Color.Black), 10, 10);
image.Save(@"c:\temp\" + Guid.NewGuid().ToString() + ".gif",
ImageFormat.Gif);

count++;
t2 = DateTime.Now;
TimeSpan timeSpan = t2 - t1;



if (timeSpan.TotalMilliseconds > 1000)
{
Console.WriteLine("IPS : " + count);
t1 = DateTime.Now;
count = 0;
}
}

and I print the number of images per second, with GDI+ I can create up to 70
less or more images per second. At this moment I don't know yet how I can
draw something on a image in Wpf.

Best regards,
Stefan


"robertwl@nospam.microsoft.com" wrote:

> Hi Stefan,
>
> The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.
>
> What kind of performance metrics are you interested in looking at?
>
> Robert.
>
> -----Original Message-----
> From: stefan_tabaranu
> Posted At: Thursday, January 05, 2006 6:06 AM
> Posted To: microsoft.public.windows.developer.winfx.avalon
> Conversation: imaging performance
> Subject: imaging performance
>
>
> Hello,
>
> I have some question about the image performance, I have a project where I
> have to create images very fast, at this moment I use GDI+ to do that, also I
> tried to use DirectX to create images but it seems that GPUs are not designed
> for reading, to copy an image from a Surface is very slow.
>
> My question is how is the WPF performace compared with GDI+, for image
> creation the power of GPU is used ?
>
> Best regards,
> Stefan
>

My System SpecsSystem Spec
Old 01-10-2006   #4 (permalink)
robertwl@nospam.microsoft.com


 
 

re: imaging performance

In order to draw visuals into an image, try using the RenderTargetBitmap. With the RenderTargetBitmap, you can save that to a file.

Sample:

using System.Windows.Media;
using System.Windows.Media.Imaging;

...

RenderTargetBitmap rtb = new RenderTargetBitmap(width, height, dpiX, dpiY, PixelFormats.Pbgra32);

// visual is where your text, graphics, etc is
rtb.Render(visual);

PngBitmapEncoder png = new PngBitmapEncoder();
png.Frames.Add(BitmapFrame.Create(rtb));
using (Stream stm = File.Create("foo.png"))
{
png.Save(stm);
}

-----Original Message-----
From: stefan_tabaranu
Posted At: Thursday, January 05, 2006 11:43 PM
Posted To: microsoft.public.windows.developer.winfx.avalon
Conversation: imaging performance
Subject: re: imaging performance


In my test I only draw something on the image and after that I save the image
on the hard drive like this:

while (true)
{

gfx.DrawString(new Guid().ToString(), font, new
SolidBrush(Color.Black), 10, 10);
image.Save(@"c:\temp\" + Guid.NewGuid().ToString() + ".gif",
ImageFormat.Gif);

count++;
t2 = DateTime.Now;
TimeSpan timeSpan = t2 - t1;



if (timeSpan.TotalMilliseconds > 1000)
{
Console.WriteLine("IPS : " + count);
t1 = DateTime.Now;
count = 0;
}
}

and I print the number of images per second, with GDI+ I can create up to 70
less or more images per second. At this moment I don't know yet how I can
draw something on a image in Wpf.

Best regards,
Stefan


"robertwl@nospam.microsoft.com" wrote:

> Hi Stefan,
>
> The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.
>
> What kind of performance metrics are you interested in looking at?
>
> Robert.
>
> -----Original Message-----
> From: stefan_tabaranu
> Posted At: Thursday, January 05, 2006 6:06 AM
> Posted To: microsoft.public.windows.developer.winfx.avalon
> Conversation: imaging performance
> Subject: imaging performance
>
>
> Hello,
>
> I have some question about the image performance, I have a project where I
> have to create images very fast, at this moment I use GDI+ to do that, also I
> tried to use DirectX to create images but it seems that GPUs are not designed
> for reading, to copy an image from a Surface is very slow.
>
> My question is how is the WPF performace compared with GDI+, for image
> creation the power of GPU is used ?
>
> Best regards,
> Stefan
>

My System SpecsSystem Spec
Old 01-10-2006   #5 (permalink)
StefanT


 
 

re: imaging performance

Thx a lot Robert for you response.

Also those types for imaging are using GPU video card or the PC CPU it's
used ?

Best regards,
Stefan

"robertwl@nospam.microsoft.com" wrote:

> In order to draw visuals into an image, try using the RenderTargetBitmap. With the RenderTargetBitmap, you can save that to a file.
>
> Sample:
>
> using System.Windows.Media;
> using System.Windows.Media.Imaging;
>
> ...
>
> RenderTargetBitmap rtb = new RenderTargetBitmap(width, height, dpiX, dpiY, PixelFormats.Pbgra32);
>
> // visual is where your text, graphics, etc is
> rtb.Render(visual);
>
> PngBitmapEncoder png = new PngBitmapEncoder();
> png.Frames.Add(BitmapFrame.Create(rtb));
> using (Stream stm = File.Create("foo.png"))
> {
> png.Save(stm);
> }
>
> -----Original Message-----
> From: stefan_tabaranu
> Posted At: Thursday, January 05, 2006 11:43 PM
> Posted To: microsoft.public.windows.developer.winfx.avalon
> Conversation: imaging performance
> Subject: re: imaging performance
>
>
> In my test I only draw something on the image and after that I save the image
> on the hard drive like this:
>
> while (true)
> {
>
> gfx.DrawString(new Guid().ToString(), font, new
> SolidBrush(Color.Black), 10, 10);
> image.Save(@"c:\temp\" + Guid.NewGuid().ToString() + ".gif",
> ImageFormat.Gif);
>
> count++;
> t2 = DateTime.Now;
> TimeSpan timeSpan = t2 - t1;
>
>
>
> if (timeSpan.TotalMilliseconds > 1000)
> {
> Console.WriteLine("IPS : " + count);
> t1 = DateTime.Now;
> count = 0;
> }
> }
>
> and I print the number of images per second, with GDI+ I can create up to 70
> less or more images per second. At this moment I don't know yet how I can
> draw something on a image in Wpf.
>
> Best regards,
> Stefan
>
>
> "robertwl@nospam.microsoft.com" wrote:
>
> > Hi Stefan,
> >
> > The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.
> >
> > What kind of performance metrics are you interested in looking at?
> >
> > Robert.
> >
> > -----Original Message-----
> > From: stefan_tabaranu
> > Posted At: Thursday, January 05, 2006 6:06 AM
> > Posted To: microsoft.public.windows.developer.winfx.avalon
> > Conversation: imaging performance
> > Subject: imaging performance
> >
> >
> > Hello,
> >
> > I have some question about the image performance, I have a project where I
> > have to create images very fast, at this moment I use GDI+ to do that, also I
> > tried to use DirectX to create images but it seems that GPUs are not designed
> > for reading, to copy an image from a Surface is very slow.
> >
> > My question is how is the WPF performace compared with GDI+, for image
> > creation the power of GPU is used ?
> >
> > Best regards,
> > Stefan
> >

>

My System SpecsSystem Spec
Old 01-10-2006   #6 (permalink)
robertwl@nospam.microsoft.com


 
 

re: imaging performance

Using RenderTargetBitmap is a software-only (ie: PC-CPU) pathway.

Robert.

-----Original Message-----
From: stefan_tabaranu
Posted At: Friday, January 06, 2006 3:21 PM
Posted To: microsoft.public.windows.developer.winfx.avalon
Conversation: imaging performance
Subject: re: imaging performance


Thx a lot Robert for you response.

Also those types for imaging are using GPU video card or the PC CPU it's
used ?

Best regards,
Stefan

"robertwl@nospam.microsoft.com" wrote:

> In order to draw visuals into an image, try using the RenderTargetBitmap. With the RenderTargetBitmap, you can save that to a file.
>
> Sample:
>
> using System.Windows.Media;
> using System.Windows.Media.Imaging;
>
> ...
>
> RenderTargetBitmap rtb = new RenderTargetBitmap(width, height, dpiX, dpiY, PixelFormats.Pbgra32);
>
> // visual is where your text, graphics, etc is
> rtb.Render(visual);
>
> PngBitmapEncoder png = new PngBitmapEncoder();
> png.Frames.Add(BitmapFrame.Create(rtb));
> using (Stream stm = File.Create("foo.png"))
> {
> png.Save(stm);
> }
>
> -----Original Message-----
> From: stefan_tabaranu
> Posted At: Thursday, January 05, 2006 11:43 PM
> Posted To: microsoft.public.windows.developer.winfx.avalon
> Conversation: imaging performance
> Subject: re: imaging performance
>
>
> In my test I only draw something on the image and after that I save the image
> on the hard drive like this:
>
> while (true)
> {
>
> gfx.DrawString(new Guid().ToString(), font, new
> SolidBrush(Color.Black), 10, 10);
> image.Save(@"c:\temp\" + Guid.NewGuid().ToString() + ".gif",
> ImageFormat.Gif);
>
> count++;
> t2 = DateTime.Now;
> TimeSpan timeSpan = t2 - t1;
>
>
>
> if (timeSpan.TotalMilliseconds > 1000)
> {
> Console.WriteLine("IPS : " + count);
> t1 = DateTime.Now;
> count = 0;
> }
> }
>
> and I print the number of images per second, with GDI+ I can create up to 70
> less or more images per second. At this moment I don't know yet how I can
> draw something on a image in Wpf.
>
> Best regards,
> Stefan
>
>
> "robertwl@nospam.microsoft.com" wrote:
>
> > Hi Stefan,
> >
> > The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.
> >
> > What kind of performance metrics are you interested in looking at?
> >
> > Robert.
> >
> > -----Original Message-----
> > From: stefan_tabaranu
> > Posted At: Thursday, January 05, 2006 6:06 AM
> > Posted To: microsoft.public.windows.developer.winfx.avalon
> > Conversation: imaging performance
> > Subject: imaging performance
> >
> >
> > Hello,
> >
> > I have some question about the image performance, I have a project where I
> > have to create images very fast, at this moment I use GDI+ to do that, also I
> > tried to use DirectX to create images but it seems that GPUs are not designed
> > for reading, to copy an image from a Surface is very slow.
> >
> > My question is how is the WPF performace compared with GDI+, for image
> > creation the power of GPU is used ?
> >
> > Best regards,
> > Stefan
> >

>

My System SpecsSystem Spec
Old 01-10-2006   #7 (permalink)
StefanT


 
 

re: imaging performance

Thx a lot Robert, I finally have a clear understanding about how the wpf
imaging works.

Best regards,
Stefan

"robertwl@nospam.microsoft.com" wrote:

> Using RenderTargetBitmap is a software-only (ie: PC-CPU) pathway.
>
> Robert.
>
> -----Original Message-----
> From: stefan_tabaranu
> Posted At: Friday, January 06, 2006 3:21 PM
> Posted To: microsoft.public.windows.developer.winfx.avalon
> Conversation: imaging performance
> Subject: re: imaging performance
>
>
> Thx a lot Robert for you response.
>
> Also those types for imaging are using GPU video card or the PC CPU it's
> used ?
>
> Best regards,
> Stefan
>
> "robertwl@nospam.microsoft.com" wrote:
>
> > In order to draw visuals into an image, try using the RenderTargetBitmap. With the RenderTargetBitmap, you can save that to a file.
> >
> > Sample:
> >
> > using System.Windows.Media;
> > using System.Windows.Media.Imaging;
> >
> > ...
> >
> > RenderTargetBitmap rtb = new RenderTargetBitmap(width, height, dpiX, dpiY, PixelFormats.Pbgra32);
> >
> > // visual is where your text, graphics, etc is
> > rtb.Render(visual);
> >
> > PngBitmapEncoder png = new PngBitmapEncoder();
> > png.Frames.Add(BitmapFrame.Create(rtb));
> > using (Stream stm = File.Create("foo.png"))
> > {
> > png.Save(stm);
> > }
> >
> > -----Original Message-----
> > From: stefan_tabaranu
> > Posted At: Thursday, January 05, 2006 11:43 PM
> > Posted To: microsoft.public.windows.developer.winfx.avalon
> > Conversation: imaging performance
> > Subject: re: imaging performance
> >
> >
> > In my test I only draw something on the image and after that I save the image
> > on the hard drive like this:
> >
> > while (true)
> > {
> >
> > gfx.DrawString(new Guid().ToString(), font, new
> > SolidBrush(Color.Black), 10, 10);
> > image.Save(@"c:\temp\" + Guid.NewGuid().ToString() + ".gif",
> > ImageFormat.Gif);
> >
> > count++;
> > t2 = DateTime.Now;
> > TimeSpan timeSpan = t2 - t1;
> >
> >
> >
> > if (timeSpan.TotalMilliseconds > 1000)
> > {
> > Console.WriteLine("IPS : " + count);
> > t1 = DateTime.Now;
> > count = 0;
> > }
> > }
> >
> > and I print the number of images per second, with GDI+ I can create up to 70
> > less or more images per second. At this moment I don't know yet how I can
> > draw something on a image in Wpf.
> >
> > Best regards,
> > Stefan
> >
> >
> > "robertwl@nospam.microsoft.com" wrote:
> >
> > > Hi Stefan,
> > >
> > > The performance of the imaging CODECs within WPF (they are in WindowsCodecs.dll) are faster than what GDI+ provides. This holds true for both JPEG and TIFF.
> > >
> > > What kind of performance metrics are you interested in looking at?
> > >
> > > Robert.
> > >
> > > -----Original Message-----
> > > From: stefan_tabaranu
> > > Posted At: Thursday, January 05, 2006 6:06 AM
> > > Posted To: microsoft.public.windows.developer.winfx.avalon
> > > Conversation: imaging performance
> > > Subject: imaging performance
> > >
> > >
> > > Hello,
> > >
> > > I have some question about the image performance, I have a project where I
> > > have to create images very fast, at this moment I use GDI+ to do that, also I
> > > tried to use DirectX to create images but it seems that GPUs are not designed
> > > for reading, to copy an image from a Surface is very slow.
> > >
> > > My question is how is the WPF performace compared with GDI+, for image
> > > creation the power of GPU is used ?
> > >
> > > Best regards,
> > > Stefan
> > >

> >

>

My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Disk imaging HELP !!! Software
Disk Imaging without OS? Vista file management
Vista Imaging Vista installation & setup
re-imaging Vista Vista installation & setup
Microsoft Launches Icons of Imaging Program at First Microsoft Pro Photo Summit, Recognizing Present and Future Leaders in Photography and Digital Imaging Vista News


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46