PDA

View Full Version : ▒▓█ Graphic stuff question █▓▒



bandinopla
September 13th, 2005, 04:12 PM
How do I draw in c++?? i mean, how do i use the graphic mode... I'm newbie in this, so don't talk about directX or openGL, i need, simple pixel plotting code...

ahmed
September 13th, 2005, 04:14 PM
nice title :P


I don't know C++, but I do C. Look into graphics.h

freeskier89
September 13th, 2005, 06:13 PM
In about an hour Ill give you a better description but here is a temporary one

>create a bitmap
>Use setPixel and getPixel functions

Should be something like
Bitmap canvas =new Bitmap(width,height)
//in load event

canvas.setPixel(x,y,color);

freeskier89
September 14th, 2005, 12:00 AM
The code above is in c#, but as far as I know, for that usage they should be nearly identical. Here is a better idea (this is in c# but if you know a little c++) it should be easy to adapt.
Bitmap canvas;
Formloadevent{
canvas=new Bitmap(pictureBox.width,pictureBox.height);
canvas.setPixel(0,0,Color.Red)
}As you can figure out this is really psuedocode. Hopefully this will clear up some of your problems. If not just say so and hopefully I can help you out more. :D

Edit: How do you do those squiggly things for your title?