![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | 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 Specs![]() |
| | #3 (permalink) |
| | 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 Specs![]() |
| | #4 (permalink) |
| | 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 Specs![]() |
| | #5 (permalink) |
| | 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 Specs![]() |
| | #6 (permalink) |
| | 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 Specs![]() |
| | #7 (permalink) |
| | 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 Specs![]() |
| 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 | |||