| |

VerySource

 Forgot password?
 Register
Search
View: 583|Reply: 1

Phase zoom

[Copy link]

3

Threads

10

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-1-31 15:00:02
| Show all posts |Read mode
Is it possible to add a Windows Form in ASP.NET, I want to write a picture in ASP.NET how to scale it?

Bitmap image1;

private void Button1_Click (System.Object sender, System.EventArgs e)
{

    try
    {
        // Retrieve the image.
        image1 = new Bitmap (@ "C:\Documents and Settings\All Users\"
            + @ "Documents\My Music\music.bmp", true);

        int x, y;

        // Loop through the images pixels to reset color.
        for (x = 0; x <image1.Width; x ++)
        {
            for (y = 0; y <image1.Height; y ++)
            {
                Color pixelColor = image1.GetPixel (x, y);
                Color newColor = Color.FromArgb (pixelColor.R, 0, 0);
                image1.SetPixel (x, y, newColor);
            }
        }

        // Set the PictureBox to display the image.
        PictureBox1.Image = image1;

        // Display the pixel format in Label1.
        Label1.Text = "Pixel format:" + image1.PixelFormat.ToString ();

    }
    catch (ArgumentException)
    {
        MessageBox.Show ("There was an error." +
            "Check the path to the image file.");
    }
}
Reply

Use magic Report

0

Threads

32

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-3-10 11:30:01
| Show all posts
ASP.NET supports scaling directly, without using winform forms.
Simple way:
<img src = xxx.jpg id = x>
Just use the js to set the width property
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list