Re: SetPixel() / GetPixel() for Format64bppArgb in VB using LockBits

Tech-Archive recommends: Fix windows errors by optimizing your registry



Thanks. I didn't know that one can lock just some parts of the bitmap.

So you mean if one has to set 1 pixel, just lock 1 pixel? Then one
might
naturally ask, WHY then is the gdi method get/set so slow. Couldn't
just they
do the same?? Or we are missing something here...

Perhaps it's to give us topics to discuss on!

Happy camping!

-P

PS
Do you carry the ps also under the tent :) ?

Bob Powell [MVP] ha scritto:

Hi folks,
Sorry I'm late to the party but I'm actually sitting in a tent in western
France - ostensibly on holiday :-)) -

I see from the thread that most of the problems are solved, the only
question really is why duplicate such horrible behaviour as GetPixel and
SetPixel. As you know by now, these lock the bitmap, change the data and
then unlock it. This is horribly inefficient.

A performance boost can probably be had if you only lock the one pixel of
the bitmap by providing the rectangle such as new Rectangle(x,y,1,1). This
might save you from having to lock a couple of megabytes fro one lousy
pixel.

ciao!

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.



"pamela fluente" <pamelafluente@xxxxxxxxx> wrote in message
news:1156239912.246600.84140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi dears,

I need an exact replacement of SetPixel() and GetPixel() functions
(VB.NET),
only for the specific format PixelFormat.Format64bppArgb, using
LockBits.

I have already browsed Bob's site, but I am too unfamiliar with this
stuff to attempt to produce myself these 2 functions.

I need those. Any help would be much appreciate. Thank you very much.

-Pam


.



Relevant Pages

  • Re: Pixel in Managed Direct3D
    ... if you want it in 2d you should lock the surface, calculate the pixel ... somthing about locking surfaces, but I don't know how to implement it. ...
    (microsoft.public.win32.programmer.directx.managed)
  • z value
    ... I need to get the z value in a particular pixel, ... render all the scene. ... I tryed to lock the z - buffer but it is not supported. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: z value
    ... only if the card supports D3DFMT_D16_LOCKABLE or D3DFMT_D32F_LOCKABLE. ... I need to get the z value in a particular pixel, ... > I tryed to lock the z - buffer but it is not supported. ...
    (microsoft.public.win32.programmer.directx.graphics)
  • Re: How to convert image from Format1bppIndexed to Format24bppRgb?
    ... //image you just need to create a bitmap of the correct size ... > case of conversion to any indexed type you need to understand the pixel ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ... >>> The size of the image file has no bearing on the amount of memory you ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: How to convert image from Format1bppIndexed to Format24bppRgb?
    ... bitmap will also be a 1bpp bitmap. ... case of conversion to any indexed type you need to understand the pixel ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... > of trying to create the 24bpp and generating an "out of memory" error, ...
    (microsoft.public.dotnet.framework.drawing)