Anyway to Create A GIF file or A BMP file from VB. I have a series of points and I want to create an image ploting those Points.
Printable View
Anyway to Create A GIF file or A BMP file from VB. I have a series of points and I want to create an image ploting those Points.
Consider plotting the points or whatever to a control like MSChart. Then use the BitBlt api to move the working area of the chart to a Picture box. Next, SavePicture Picture1.Picture "c:\myfile.bmp"
For GIF format you will have to use an ImgEdit control instead of a picturebox and use the SaveAs method.
Bitmap - Yes
Gif - No (sort of)
You can use this simple routine to save a bitmap image from a control like a picturebox:
I don't know of a way to save a gif through VB code...however if you look at planetsourcecode there are a couple utilities that will allow you to -convert- a bitmap to jpeg or gif format. The best one I know of is PicFormat32aCode:'in this case picture1 is a picturebox. By the way,
'even if you try to put an extension as .gif the format
'will still be in bitmap format.
savepicture picture1.image, "C:\mydir\myfile.bmp"
ok I think it is my fault I forgot to specify , I am not going to be able to use any ActiveX controls so , No Charts , No Image Comtrols , Basically I am operating from a COM object.
Huston .. we have a problem ... when I used StretchBlt to transfer the image from the Chart to a picture control ... I used saveimage ... but all it shows when I open the file is just gray backgroud as if no chart was there ...
Make sure any of the transparent fonts are turned off in properties of picturebox. Also, set autoredraw ON.