Package Com.Phy Java.Awt.Image.affinetrans Text Watermark ، Zoom ، ملحق أبيض ، إلخ * أضف صورة مائية صورة * param targetimg مسار الصورة الهدف ، مثل: c: //mypictrue//1.jpg * param watermg picture picture ، مثل: c: //mypictrue//logo.png * param x تهدف مسافة صورة العلامة المائية على الجانب الأيسر من الصورة ، إذا كانت x <0 ، ثم في الوسط* param y picture deavy من الجانب العلوي من الصورة المستهدفة ، إذا y <0 ، في الوسط* param شفافية ألفا (0.0-1.0 ، 0.0 شفافة تمامًا ، 1.0 غير شفافة تمامًا) */pressure pressical pressimage (سلسلة الهدف ، string ، int x ، inty ، alpha float) le (targetimg) ؛ قراءة (ملف) ؛ DrawImage (صورة 0 ، 0 ، ارتفاع ، صورة خالية) ؛ G.SetComposite (alphacomposite.getInstance (alphacomposite.src_atop ، alpha) ؛ {x = widthdiff ؛} if (y <0) {y = heightdiff / 2 ؛} آخر إذا (y> heightdiff) {y = heightdiff ؛} g.drawImage (waterimage ، x ، y ، width_1 ، height_1 ، null) ؛ // ملف Watermark إنهاء G.Dispose () ؛ AS: C: //mypictrue//1.jpgm @Param Presterstext Text Watermark ، مثل: China Securities Network* param fontname font name ، مثل: Song Style* param fontstyle font style style ، مثل: font. BOLD |. نص Param Y Watermark ، إزاحة الجانب العلوي من الصورة المستهدفة ، إذا كان y <0 ، في الشفافية الأوسط * param alpha (0.0 - 1.0 ، 0.0 شفاف تمامًا ، 1.0 هو 1.0 هو غير شفاف تمامًا) */عام static void presterstext (String TargetImg ، bresterstext ، سلسلة fontname ، int fontstyle ، int fontsize ، color color ، int y ، float alpha) {try {file file = new file (targetimg) ؛ int width = Image.getWidth (null) ؛ ، 0 ، 0 ، العرض ، الارتفاع ، NULL) ؛ Prestext) ؛ <0) {y = heightdiff / 2 ؛} if (y> heightdiff) {y = heightdiff ؛} g.drawstring (p. ، piction_formate_jpg ، file) ؛} catch (استثناء e) {E.PrintStackTrace () ؛}/** الطول ، مثل: "الصين" ، إرجاع 2 ؛ Length () ؛}} العائد (طول 2 == 0)؟ ارتفاع ، int ، Boolean BB) الارتفاع ، bustredimage.scale_smooth) ؛ نسبة = (ارتفاع جديد). Ratio) ، null) ؛ olor (color.white) ؛ / 2 ، itemp.getwidth (NULL) ، itemp.getheight (null) ، color. null) ، color.white ll) ؛ ic void main (string [] args) يلقي iOexception {pressImage ("c: // pic // jpg" ، "c: //pic/test.gif" ، 5000 ، 5000 ، 0f) ؛ /pic // jpg "،" 旺仔之印 "،" 宋体 "، font.bold | font.italic ، 20 ، color.black ، 0 ، 0 ، 8f) ؛ Resize (" c: // pic // 4 .jpg "، 1000 ، 500 ، صواب) ؛}}