Solved

I have problem  with graphics of  c++builder.Help me please.

Posted on 1999-01-25
7
190 Views
Last Modified: 2010-04-02
Pardon in my English.
        I want to know that I will use ScanLine() command in order to store pixel value in buffer.
After I will bring it to pass my process in order to check color value of each pixel.Then I will bring
color value of each pixel push in New File(*.BMP). All process make in 256 colors BItmap.
Please show example program for me ....... THANK YOU VERY MUCH
0
Comment
Question by:s8014026
  • 3
  • 3
7 Comments
 
LVL 22

Expert Comment

by:nietod
ID: 1185048
That's hard to understand.  There are a lot of experts from all over the world here.  Why not try it in your native language?  (Or try again a little more detailed in english.)
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1185049
Do you mean something like this,

Use scanline() to read a line of pixels into a buffer,
Read the buffer to check the value for each pixel,
Write the pixels into a new 256 color bitmap.

:O)
0
 

Author Comment

by:s8014026
ID: 1185050
To Bruintje
  Right,you understand me. I will use scanline()to read pixel
from picture after that I will push it into buffer,Read the buffer to check the value for each pixel,  Write the pixels into a new 256 color bitmap.
Please tell method and give example program for me.
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 44

Expert Comment

by:bruintje
ID: 1185051
Well hope some of the other experts can answer this question now, I have to learn in this field too much to provide you with an answer
:O)
0
 
LVL 22

Expert Comment

by:nietod
ID: 1185052
Well, unfortunately.  Very few experts use BC Builder.  Most use the windows API directly or use MFC.  Thus builder questions often don't get answered.  If it wasn't for that I would have answered sooner.  I have builder, so I'll see if I can find something.
0
 
LVL 22

Accepted Solution

by:
nietod earned 200 total points
ID: 1185053
Okay, I think I have an idea of what you need to do.  I'll do my best to sketch it out.  You may need to ask questions and we may need to make changes as we go along, but this is a good start.

1.  Create a 2nd TBitmap.  (We'll call it the destination bitmap.)
2.  Set the dimensions of the destination TBitmap to the dimensions of the source bitmap.
This is done with the "Height" and "Width" properties.
3.  Create a canvas for the destination bitmap using the "Canvas" property, we will call this the destiantion canvas
3.  Use a for loop that goes from 0 to the height-1
4.  In the for loop, use scanline to optain a single line of pixels.
5.  Use a for loop that goes from 0 to width-1.
6.  In this for loop, Use the destination canvas's "Pixels" property to set the pixel to the value you want.
7.  After the two for loops end use the :"SaveToFile" method to write out the destination bitmap.

That should get you started.  Let me know if you have any questions.
0
 
LVL 44

Expert Comment

by:bruintje
ID: 1185054
>>Nietod: If I had the money I would get a copy myself, I've Borland C++ 4.52, as a full-time Delphi builder I indeed use the API. As I said I'm new in this field but very interested.

Thanks for takin' it from here :O).
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now