[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

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

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
s8014026
Asked:
s8014026
  • 3
  • 3
1 Solution
 
nietodCommented:
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
 
bruintjeCommented:
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
 
s8014026Author Commented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
bruintjeCommented:
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
 
nietodCommented:
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
 
nietodCommented:
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
 
bruintjeCommented:
>>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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now