PDA

View Full Version : * Beta * Dynamic Drawing tool : PutPixel


clueless
02-03-2008, 10:00 PM
This is a very simple CommandLine Program i made for use in AMS that lets you put a pixel of any colour into an image. The drawing operation is very fast so this may be able to stretch to making bar graphs or simple drawing operations.Its pretty much untested at the moment. It accepts most of the major image formats but will only write to BMP.
File size 72kb :yes

Syntax

[Pic.bmp] [Output.bmp] [X] [Y] [Red 0-255] [Green 0-255]

[Pic.bmp] The image to be altered

[Output.bmp] The Output filename

[X] X position of pixel
[Y] Y position of pixel

[Red 0-255]
[Green 0-255]
[Blue 0-255]


[B]Example

File.Run("AutoPlay\\Progs\\PutPixel.exe", "c:\\APic c:\\OutPic.bmp 100 100 255 255 255,"", SW_SHOWNORMAL, true);

Would place a white pixel at position x=100,y=100 on the image and then save it with the filename OutPic.bmp.

Note: all file names have to be 'short' filenames to avoid extra spaces in the commanline which will cause errors.

You can use this in your own projects. A small note of credit would be appreciated in anything you use it for.
Have fun :D

AudioSam
02-04-2008, 02:15 AM
I tried your app.

I know you put some work into it and it's nice knowing
someone looked at it.

I will get back to you.

Thanks,
AudioSamIam:yes

clueless
02-04-2008, 10:28 AM
Thanks, im not sure how usfull it will be , it depends on how fast AMS can run the prog and read the picture back in. The next step would be to add a function to make lines and box's so that people making bar graphs wouldnt have to perform so many operations to produce an image.

clueless
02-07-2008, 06:03 PM
This is a much improved version. Ive change the order of the command line around a bit so you can set more than pixel at a time.

[SourceFile] [TargetFile] [Red] [Green] [Blue] [x] [y]

then after that you put the x and y coordinates of the pixels you want to set. They will all be set to the same color.

[SourceFile] [TargetFile] [Red] [Green] [Blue] [x] [y] [x] [y] [x] [y]
..Until you run out of command line space.

Heres a simple random dot demo.
The program is still in development so it might throw the odd error now and then.

holtgrewe
02-07-2008, 10:36 PM
...just a thought, instead of stringing out the x,y coordinates, how about giving the starting x,y and the ending x,y and draw a line by connecting the two coordinates...
If someone needs to draw a curve, they can always have the option to specify individual pixels.

That being said, very nice job getting this working.