A Bitmap from a Bitmap

R

RicercatoreSbadato

===========
INTRODUCTION:
===========
I'd like to take only a part of a Bitmap. I'm workin in unsafe mode with
the pointers:

unsafe
{
byte * p_init = (byte *)(void *)Scan0;
byte * p_I = <pointer a pixel of the current Bitmap>;

Bitmap bmp = new Bitmap(width, height, IMG_stride,
PixelFormat.Format8bppIndexed,
*p_I);
}

===========
THE PROBLEM:
===========
It seems that p_I isn't a valid System.IntPtr . Help me pls to take a
Bitmap from the whole Bitmap...
 
R

RicercatoreSbadato

And if I utilize the
(Bitmap) IMG.Clone() method ?

Anyone else has yet try to do that?
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,

Why are you using unsafe?

what about if you use Bitmap.Clone( ) ?

cheers,
 
I

Ignacio Machin \( .NET/ C# MVP \)

did u try it?

IMO that's the way to go, but I have no idea of your environment nor how you
get the original bitmap

cheers,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top