473,322 Members | 1,523 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

A Bitmap from a Bitmap

===========
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...

--
RicercatoreSbadato
Nov 17 '05 #1
3 1461
And if I utilize the
(Bitmap) IMG.Clone() method ?

Anyone else has yet try to do that?

--
RicercatoreSbadato
Nov 17 '05 #2
Hi,

Why are you using unsafe?

what about if you use Bitmap.Clone( ) ?

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation
"RicercatoreSbadato" <Ri****************@nomail.it> wrote in message
news:%J*******************@tornado.fastwebnet.it.. .
===========
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...

--
RicercatoreSbadato

Nov 17 '05 #3
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,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"RicercatoreSbadato" <Ri****************@nomail.it> wrote in message
news:xN*******************@tornado.fastwebnet.it.. .
And if I utilize the
(Bitmap) IMG.Clone() method ?

Anyone else has yet try to do that?

--
RicercatoreSbadato

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sharon | last post by:
I encountered a strange behavior when doing ‘new Bitmap’: The following code works fine and the given bitmap file is shown on the PictureBox (the m_DrawArea) in the correct bitmap sizes: ...
5
by: Lance | last post by:
I need to create a Drawing.Bitmap from an array of integer values. My current technique creates a bitmap that eventually becomes corrupt (i.e., the bitmap's pixels change to a different color...
8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
7
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
0
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
8
by: Joergen Bech | last post by:
Suppose I have Dim bm As New Bitmap(16, 16,Imaging.PixelFormat.Format8bppIndexed) I cannot use Dim g As Graphics = Graphics.FromImage(bmdest) Dim hdc As IntPtr = g.GetHdc() as the...
6
by: \Frank\ | last post by:
I trying to learn what a Bitmap is. Not a Managed Bitmap Object but one that, for example, comes from the clipboard with CF_BITMAP. I'm guessing that a CompatableBitmap is an array of indices...
2
by: Peter Oliphant | last post by:
I want to create a new Bitmap which is a portion of an existing Bitmap. For example, if I have a Bitmap that is 100x100 in size I might want to create a new Bitmap that is equivalent to the one...
5
by: =?Utf-8?B?QVRU?= | last post by:
I have a bitmap of 100X100. On the load, the bitmap is created by a function (createimage()). On my OnPaint, I draw the image back to the screen (e.Graphics.DrawImage( bitmap, destrect)). Now,...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.