473,387 Members | 1,760 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,387 software developers and data experts.

What is a Bitmap's memory layout?

On the Internet there are many descriptions of the memory layout for a DIB.

But none that I can find for a Bitmap.

Is that because a Bitmap's layout depends on a related device.

If that's the case, is a clipboard's Bitmap layout always related to the
screen?

Thanx
Aug 17 '07 #1
6 4415
Hi,

A bitmap is just that, a map of bits

Each pixel is represented by a given number of bytes (Depending of the
resolution) and they are row after row.

Is that enuogh?

""Frank"" <Fr***@a-znet.comwrote in message
news:ew**************@TK2MSFTNGP02.phx.gbl...
On the Internet there are many descriptions of the memory layout for a
DIB.

But none that I can find for a Bitmap.

Is that because a Bitmap's layout depends on a related device.

If that's the case, is a clipboard's Bitmap layout always related to the
screen?

Thanx

Aug 17 '07 #2
"Frank" wrote:
On the Internet there are many descriptions of the memory layout for a DIB.

But none that I can find for a Bitmap.
Do you mean the System.Drawing.Bitmap class?

If so, use the LockBits method to access the image data. It provides you
with a BitmapData object that contains the information you need to
access the data. You don't have to bother about details of the memory
layout, like if it's stored top-down or bottom-up.
Is that because a Bitmap's layout depends on a related device.
What related device? The layout depends on the pixel format of the bitmap.
If that's the case, is a clipboard's Bitmap layout always related to the
screen?
Why would it be? Any program can place a Bitmap in the clipboard, so the
format would be decided by the program.

--
Göran Andersson
_____
http://www.guffa.com
Aug 17 '07 #3
I meant the Windows Bitmap
I did find the description of how to save a Windows GDI Bitmap on a file and
it's the same as that for saving a DIB.

But often I see on the Clipboard "Bitmap" as well as "DIB Bitmap"
There is also CF_Bitmap and CF_DIB

Are they really saved the same on a file?

What is the difference between what is retrieved from a Bitmap (CF_Bitmap)
and a DIB(CF_DIB) from the clipboard?
Thanx
Added "pointed to by HBITMAP"
>On the Internet there are many descriptions of the memory layout for a
DIB.
But none that I can find for a Bitmap pointed to by HBITMAP
Is that because a Bitmap's layout depends on a related device.
If that's the case, is a clipboard's Bitmap layout always related to the
screen?

Aug 17 '07 #4
I meant the Windows Bitmap
I did find the discription of how to save a Windows GDI Bitmap on a file and
it's the same as that for saving a DIB.

But often I see on the Clipboard "Bitmap" as well as "DIB Bitmap"
There is also CF_Bitmap and CF_DIB

Are they really saved the same on a file?

What is the difference between what is retrieved from a Bitmap (CF_Bitmap)
and a DIB(CF_DIB) from the clipboard?
Thanx
Aug 17 '07 #5
"Frank" wrote:
I meant the Windows Bitmap
There are several different ways of representing a bitmap, both in
memory and as files.
I did find the description of how to save a Windows GDI Bitmap on a file and
it's the same as that for saving a DIB.
That's not surprising. A GDI Bitmap can't be saved as a useful format,
so you save a GDI Bitmap in DIB format.
But often I see on the Clipboard "Bitmap" as well as "DIB Bitmap"
There is also CF_Bitmap and CF_DIB
The clipboard format values all start with CF_, so "Bitmap" and "DIB
Bitmap" are only descriptions of the formats.

MSDN: Clipboard Formats:
http://msdn2.microsoft.com/en-us/library/ms649013.aspx
Are they really saved the same on a file?

What is the difference between what is retrieved from a Bitmap (CF_Bitmap)
and a DIB(CF_DIB) from the clipboard?
CF_BITMAP is a handle to a bitmap object. CF_DIB is a DIB bitmap object.
You can retrieve any of those as either of those, as the system can
convert between them.

--
Göran Andersson
_____
http://www.guffa.com
Aug 18 '07 #6
CF_BITMAP is a handle to a bitmap object.

I'm having trouble phrasing my question because of lack of background.

But given the above handle, assuming I can use it to get an object from the
clipboard. what is that object like?

Is it a DDB that is oriented to the screen?

Or something else?

Thanks for staying with me on this
Aug 18 '07 #7

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

Similar topics

5
by: Stan Shankman | last post by:
C# -- Visual Studio.Net – Windows Application Greetings all, How do I copy a Form’s image to a bitmap? – And do so before it gets to the screen. I haven’t been able to find anyone that knows...
9
by: SStory | last post by:
I use a bitmap class new bitmap(filepath) this should and does load my jpg into memory. I then want to use mybitmap.save(filepath,imaging.imageformat.jpeg) to save it; overwriting the...
0
by: bcutting | last post by:
I have the following snippet of code which which makes a call into a dll to generate an array of bytes. Its arguments are a IntPtr to the bitmap, a number, and a reference to the array that it...
1
by: Smokey Grindel | last post by:
I have a bitmap object I want to return as a JPEG image with a compression set at 90% and progressive passes enabled, how can I do this in .NET 2.0? Progressive passes are not necessary but the...
12
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or...
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...
3
by: Samuel | last post by:
I need to read a tiff Image and change it slightly. Currently I create a bitmap then I draw the original image and do the changes. Since the tiff is very large in size the bitmap takes a huge...
20
by: Joe Duchtel | last post by:
Hello - I have the following code to get a bitmap from the clipboard and to save it to a *.png file ... Dim lData As IDataObject = Clipboard.GetDataObject() If...
3
tranc3d
by: tranc3d | last post by:
Hello again! I have to generate a large 2 color bitmap (b & w, the layout of a pcb based on gerber file) and for the moment i am drawing into a 24bpp bitmap which is a big waste of memory. The...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.