تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[سؤال] تغيير كود جافا الى فيجوال بيسك
#1
السلام عليكم
هل هناك من ييرمج بلغة الجافا ويمكنه ان يغير لي هذا الكود الى كود فيجوال بيسك؟؟


/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package javaapplication5;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.*;
import java.awt.*;
/**
 *
 * @author home
 */
public class JavaApplication5 {

    /**
     * @param args the command line arguments
     * @throws java.io.IOException
     */
    public static void main(String[] args) throws IOException{
        // TODO code application logic here
     File file = new File("bear.jpg"); // I have bear.jpg in my working directory
        FileInputStream fis = new FileInputStream(file);
        BufferedImage image = ImageIO.read(fis); //reading the image file

        int rows = 4; //You should decide the values for rows and cols variables
        int cols = 4;
        int chunks = rows * cols;

        int chunkWidth = image.getWidth() / cols; // determines the chunk width and height
        int chunkHeight = image.getHeight() / rows;
        int count = 0;
        BufferedImage imgs[] = new BufferedImage[chunks]; //Image array to hold image chunks
        for (int x = 0; x < rows; x++) {
            for (int y = 0; y < cols; y++) {
                //Initialize the image array with image chunks
                imgs[count] = new BufferedImage(chunkWidth, chunkHeight, image.getType());

                // draws the image chunk
                Graphics2D gr = imgs[count++].createGraphics();
                gr.drawImage(image, 0, 0, chunkWidth, chunkHeight, chunkWidth * y, chunkHeight * x, chunkWidth * y + chunkWidth, chunkHeight * x + chunkHeight, null);
                gr.dispose();
            }
        }
        System.out.println("Splitting done");

        //writing mini images into image files
        for (int i = 0; i < imgs.length; i++) {
            ImageIO.write(imgs[i], "jpg", new File("img" + i + ".jpg"));
        }
        System.out.println("Mini images created");
    
    }
    
}
الرد }}}
تم الشكر بواسطة:


الردود في هذا الموضوع
تغيير كود جافا الى فيجوال بيسك - بواسطة amna jamal - 22-01-18, 02:51 AM

المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  جهاز ارسال رسائل SMS من خلال برنامج فيجوال بيسك جيولوجي مبتدئ 4 1,023 05-09-25, 12:37 PM
آخر رد: جيولوجي مبتدئ
  مساعدة في كيفية ترحيل البيانات من داتا قريدفيو إلى داتا قريدفيو في فيجوال بيسك ahmedfa71 13 2,248 09-07-25, 11:24 PM
آخر رد: أبو خالد الشكري
  [VB.NET] حفظ تنسيق الفورم ثم تطبيقة علي فورم اخر فيجوال بيسك abo ragab 7 1,233 09-07-25, 12:45 AM
آخر رد: abo ragab
  مساعدة في تحويل الكود من فيجوال بسيك 6 الى فيجوال دوت نت سيد أحمد 5 821 23-03-25, 10:54 PM
آخر رد: سيد أحمد
  [سؤال] تغيير الفورم الرئيسي عند تشغيل البرنامج في Visual Studio مع .NET 8؟ silverlord 2 655 09-03-25, 03:52 AM
آخر رد: silverlord
  كيف يمكن تحويل ملف تنفيذى الى فيجوال بيسك 2010 walkady 2 782 07-02-25, 07:57 PM
آخر رد: الورد2
Lightbulb [مشروع] مطلوب برنامج نظام صيدليه بالفيجوال بيسك 2010 May-5 13 10,785 07-02-25, 07:55 PM
آخر رد: الورد2
  [كود] كود تغيير حجم النص في التكست بوكس hassan 8 8,798 30-01-25, 02:33 AM
آخر رد: خالد كامل1
  كيفية التعامل مع inputbox في فيجوال ستوديو أسامة حسين 4 3,514 14-01-25, 02:04 AM
آخر رد: أبو خالد الشكري
  تغيير أسم ملف DOX.1 3 3,275 01-01-25, 09:37 PM
آخر رد: anes

التنقل السريع :


يقوم بقرائة الموضوع: