473,804 Members | 3,081 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4445
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******** ******@TK2MSFTN GP02.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
2380
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 how to do this - - all I want to do is copy a Form’s image to a bitmap. - - In effect, I want to take a window-shot of a Form, (as opposed to a “screen-shot”) but it must be done before that Form hits the screen. Anyone? Ideas?
9
8443
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 original. If this outfile path is different there is no problem but when it is the same file it blows up with a generic GDI+error.
0
1748
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 will output. -- Start DLL code snippet private static extern unsafe Int16 GetHash(IntPtr Bitmap1, Int16 FilterNum, void* ImageHash); /// <summary> /// Creates an hash using the pointer to the image bitmap
1
7833
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 compression ratio is.. thanks!
12
3363
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 draw it into a Bitmap. Is there a graphics method that can help?
6
2478
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 that point to the colors in a Palette of the display driver. So if I get a bitmap via CF_BITMAP I need to also get a Palette off the clipboard and realize it then display the bitmap. I believe "Realize it" means to put it into the display driver.
3
3937
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 amount of memory Is there anyway to create a bitmap and keep the image compressed?
20
7019
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 lData.GetDataPresent(DataFormats.Bitmap) Then Dim lPictureBox As New PictureBox
3
6058
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 problem is that i don't know how to do it because visual studio throws me an exception when i try to create a graphics object based on the 1bpp indexed pixelformat. Is there a way to draw directly in the indexed bitmap, without using any...
0
9575
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10564
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10320
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10308
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9134
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7609
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.