Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to load an bitmap image with raw data?

Posted on 1997-07-06
2
Medium Priority
?
1,204 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

721 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