?
Solved

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

Posted on 1999-01-25
7
Medium Priority
?
198 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
[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
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 600 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
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 video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

771 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