imgconv.C: Open rose512.jpg and save it in the following formats: | Image Processing | rose_image.C: Display image in a new canvas and pad. |
void pad2png() { // Create a canvas and save as png. //Author: Valeriy Onuchin TCanvas *c = new TCanvas; TH1F *h = new TH1F("gaus", "gaus", 100, -5, 5); h->FillRandom("gaus", 10000); h->Draw(); gSystem->ProcessEvents(); TImage *img = TImage::Create(); //img->FromPad(c, 10, 10, 300, 200); img->FromPad(c); img->WriteImage("canvas.png"); delete h; delete c; delete img; }