![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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) |
| | BitmapFrame GetPixel/SetPixel Hi all, is there any way to get or set the color pixel for an instance of BitmapFrame, or shall I use the Bitmap class ? In GDI+ the bitmap class have a GetPixel and SetPixel. Best regards, Stefan |
My System Specs![]() |
| | #2 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel If you're using the RenderTargetBitmap approach to creating frames of a GIF, then you can use the VisualOpacity and/or VisualOpacityMask properties on Visual. Is that what you're looking to do? Cheers, Robert. -----Original Message----- From: stefan_tabaranu Posted At: Monday, January 09, 2006 8:26 AM Posted To: microsoft.public.windows.developer.winfx.avalon Conversation: BitmapFrame GetPixel/SetPixel Subject: re: BitmapFrame GetPixel/SetPixel Yap, that's it, I manage to set the color pixel, thx a lot. Another question, for animated gif we can use GifBitmapEncoder and I can add frames. Is there any way to set the opacity of the frame, how much time a frame is displayed, looping ... Best regards, Stefan "robertwl@nospam.microsoft.com" wrote: > The only way to do this is to: > 1. CopyPixels into an array (of bytes or ints or floats, depending on the pixel format you're interested in) > 2. update the pixels > 3. use BitmapSource.Create to create a new BitmapSource > > Robert. > > -----Original Message----- > From: stefan_tabaranu > Posted At: Monday, January 09, 2006 6:30 AM > Posted To: microsoft.public.windows.developer.winfx.avalon > Conversation: BitmapFrame GetPixel/SetPixel > Subject: BitmapFrame GetPixel/SetPixel > > > Hi all, > > is there any way to get or set the color pixel for an instance of > BitmapFrame, or shall I use the Bitmap class ? > In GDI+ the bitmap class have a GetPixel and SetPixel. > > Best regards, > Stefan > |
My System Specs![]() |
| | #3 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel Thx a lot Robert for you help, you really help me a lot. When I try to create animated gifs in Photoshop you can set properties for each frame in the gif. Properties like how much time a frame is dispayed, opacity of the frame. I need something at level frame. Best regards, Stefan "robertwl@nospam.microsoft.com" wrote: > If you're using the RenderTargetBitmap approach to creating frames of a GIF, then you can use the VisualOpacity and/or VisualOpacityMask properties on Visual. > > Is that what you're looking to do? > > Cheers, > > Robert. > > -----Original Message----- > From: stefan_tabaranu > Posted At: Monday, January 09, 2006 8:26 AM > Posted To: microsoft.public.windows.developer.winfx.avalon > Conversation: BitmapFrame GetPixel/SetPixel > Subject: re: BitmapFrame GetPixel/SetPixel > > > Yap, that's it, I manage to set the color pixel, thx a lot. > > Another question, for animated gif we can use GifBitmapEncoder and I can add > frames. Is there any way to set the opacity of the frame, how much time a > frame is displayed, looping ... > > Best regards, > Stefan > > "robertwl@nospam.microsoft.com" wrote: > > > The only way to do this is to: > > 1. CopyPixels into an array (of bytes or ints or floats, depending on the pixel format you're interested in) > > 2. update the pixels > > 3. use BitmapSource.Create to create a new BitmapSource > > > > Robert. > > > > -----Original Message----- > > From: stefan_tabaranu > > Posted At: Monday, January 09, 2006 6:30 AM > > Posted To: microsoft.public.windows.developer.winfx.avalon > > Conversation: BitmapFrame GetPixel/SetPixel > > Subject: BitmapFrame GetPixel/SetPixel > > > > > > Hi all, > > > > is there any way to get or set the color pixel for an instance of > > BitmapFrame, or shall I use the Bitmap class ? > > In GDI+ the bitmap class have a GetPixel and SetPixel. > > > > Best regards, > > Stefan > > > |
My System Specs![]() |
| | #4 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel I think it's awfully inefficient way to modify one or a few pixels of a large bitmap. Do you have any plan to support more efficient way of bitmap modification such as direct access to the bitmap buffer? Jake "robertwl@nospam.microsoft.com" wrote: > The only way to do this is to: > 1. CopyPixels into an array (of bytes or ints or floats, depending on the pixel format you're interested in) > 2. update the pixels > 3. use BitmapSource.Create to create a new BitmapSource > > Robert. > > -----Original Message----- > From: stefan_tabaranu > Posted At: Monday, January 09, 2006 6:30 AM > Posted To: microsoft.public.windows.developer.winfx.avalon > Conversation: BitmapFrame GetPixel/SetPixel > Subject: BitmapFrame GetPixel/SetPixel > > > Hi all, > > is there any way to get or set the color pixel for an instance of > BitmapFrame, or shall I use the Bitmap class ? > In GDI+ the bitmap class have a GetPixel and SetPixel. > > Best regards, > Stefan > |
My System Specs![]() |
| | #5 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel Joh wrote: > I think it's awfully inefficient way to modify one or a few pixels of > a large > bitmap. > Do you have any plan to support more efficient way of bitmap > modification > such as direct access to the bitmap buffer? It's probably because of the underlying architecture. If I'm not mistaken, when working with GPUs, you have to transfer the data out of system memory across to the GPUs memory. Therefore you cannot share the buffer. Graphics programming gurus feel free to correct me if I'm wrong. ![]() HTH, Drew |
My System Specs![]() |
| | #6 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel Anyway I used the scheme described by Robert with CopyPixels and it's working just fine. The Bitmap class had those methods SetPixel(x,y,color), GetPixel(x,y) and with GDI+ is relative simple to change pixels colors. Best regards, Stefan "Joh" wrote: > I think it's awfully inefficient way to modify one or a few pixels of a large > bitmap. > Do you have any plan to support more efficient way of bitmap modification > such as direct access to the bitmap buffer? > > Jake > > "robertwl@nospam.microsoft.com" wrote: > > > The only way to do this is to: > > 1. CopyPixels into an array (of bytes or ints or floats, depending on the pixel format you're interested in) > > 2. update the pixels > > 3. use BitmapSource.Create to create a new BitmapSource > > > > Robert. > > > > -----Original Message----- > > From: stefan_tabaranu > > Posted At: Monday, January 09, 2006 6:30 AM > > Posted To: microsoft.public.windows.developer.winfx.avalon > > Conversation: BitmapFrame GetPixel/SetPixel > > Subject: BitmapFrame GetPixel/SetPixel > > > > > > Hi all, > > > > is there any way to get or set the color pixel for an instance of > > BitmapFrame, or shall I use the Bitmap class ? > > In GDI+ the bitmap class have a GetPixel and SetPixel. > > > > Best regards, > > Stefan > > |
My System Specs![]() |
| | #7 (permalink) |
| | re: BitmapFrame GetPixel/SetPixel Well, a question about CopyPixels method, when I copy the pixels I get an array of ints. Those ints are the ARGB encoding for a color ? What is the relation between color palette and the pixels, I mean what is happening when a color is missing from a color palette and I set that color for a specified pixel. Best regards, Stefan "StefanT" wrote: > Anyway I used the scheme described by Robert with CopyPixels and it's working > just fine. > > The Bitmap class had those methods SetPixel(x,y,color), GetPixel(x,y) and > with GDI+ is relative simple to change pixels colors. > > Best regards, > Stefan > > "Joh" wrote: > > > I think it's awfully inefficient way to modify one or a few pixels of a large > > bitmap. > > Do you have any plan to support more efficient way of bitmap modification > > such as direct access to the bitmap buffer? > > > > Jake > > > > "robertwl@nospam.microsoft.com" wrote: > > > > > The only way to do this is to: > > > 1. CopyPixels into an array (of bytes or ints or floats, depending on the pixel format you're interested in) > > > 2. update the pixels > > > 3. use BitmapSource.Create to create a new BitmapSource > > > > > > Robert. > > > > > > -----Original Message----- > > > From: stefan_tabaranu > > > Posted At: Monday, January 09, 2006 6:30 AM > > > Posted To: microsoft.public.windows.developer.winfx.avalon > > > Conversation: BitmapFrame GetPixel/SetPixel > > > Subject: BitmapFrame GetPixel/SetPixel > > > > > > > > > Hi all, > > > > > > is there any way to get or set the color pixel for an instance of > > > BitmapFrame, or shall I use the Bitmap class ? > > > In GDI+ the bitmap class have a GetPixel and SetPixel. > > > > > > Best regards, > > > Stefan > > > |
My System Specs![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Vista and GDI's SetPixel | Vista General | |||