Solved

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

Posted on 1999-01-25
7
184 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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.

757 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

22 Experts available now in Live!

Get 1:1 Help Now