Method for making watermarking

xiaoxiao2021-03-06  89

http://blog.9cbs.net/zhgroup/Archive/2004/08/20/80296.aspx

// Method: Generate a watermark picture // sourcefile: To generate a watermark picture // WatermarkFile: Picture of watermark: Picture file // Savefile: Picture of Watermark Public Static Bool MakewaterImage (String Sourcefile, String WatermarkFile, string savefile) {bool result; try {// picture Bitmap sImage = new Bitmap (sourceFile); int sWidth = sImage.Width; int sHeight = sImage.Height; // the watermark Bitmap wImage = new Bitmap (waterMarkFile); int wWidth = wImage .Width; int wheight = wiMage.height;

// make graphics. graphics g = graphics.fromimage (simage); int x; // Temporary variable int y; // Memachment Variable INT X1; / / The width of the original image and the watermarking map INT Y1; // original map And the height difference INT W; // generated watermark map of the width INTH; // generated watermark diagram high int al; // alpha int r; // red int gl; // Green Int BL; / / Blue

IF (swidth> wwidth) {x1 = swidth - wwidth; y1 = sheight - wheight; w = wwidth; h = wheight;} else {x1 = 0; y1 = 0; w = swidth; h = sheight;} // Start Drawing for (x = 1; x

But this cannot be added to the GIF format. .

转载请注明原文地址:https://www.9cbs.com/read-124979.html

New Post(0)