Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to load an bitmap image with raw data?

Posted on 1997-07-06
2
Medium Priority
?
1,252 Views
Last Modified: 2010-04-06
I'm looking for tips as to how to load a bitmap in C++ Builder (hopefully its the same as Delhi ;-).

The built in methods seem to be for loading from file, clipboard or another bitmap!

What's a good way of loading a pixel, a line or even the whole bitmap with raw data - apart from saving to a BMP first!

Thanks
Chris Hart
chris.hart@iee.org
0
Comment
Question by:chrishart
2 Comments
 
LVL 1

Accepted Solution

by:
ygolan earned 400 total points
ID: 1338332
Chris,

To access the specific pixels, use the Bitmap.Canvas.Pixels[X, Y]  property. To access a line of pixels you can use Bitmap.ScanLine property - it will give you a pointer to the pixels of a specific line in the bitmap.

To load the bitmap with raw data, create a memory stream (TMemoryStream), write the raw data to the stream and use Bitmap.LoadFromStream.
0
 

Author Comment

by:chrishart
ID: 1338333
Excellent, very quick and to the point.

I'm just embarrased I couldn't get this stuff out of the docs :-(

Thanks you ygolan!

Chris
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question