Hello,
i have created borderless form with transparent png as bacground image but i have issue.

Border edges isnt smooth

image

Its like in this picture on the left and i need it to be smooth.

How can i make it smooth?

Thanks in advance

Recommended Answers

All 7 Replies

It looks like your png is being scaled up to cover the area, use a higher resolution picture.

PNG Picure is 640x480
Form is 640x480

Didnt zoom or scale it

As Momerath said, use a higher resolution image, the reason the image isn't smooth is because there aren't enough pixels per-inch. After all a dish is only as good as its ingredients...

example image

i have tryied with higher DPI also but no luck
corners are just not smooth as in image
can i somehow add shadow or something

Are they smoother at all ? make it as high res as possible.

You could try editing it yourself in Adobe or and an application like that to ensure its precise.

You can draw a border by setting the SmoothingMode as AntiAlias.

    // Set the SmoothingMode property to smooth the line.
    e.Graphics.SmoothingMode = 
        System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

i did try that and

private void Form1_Paint(object sender, PaintEventArgs e)
{
e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
e.Graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality;
}

but no luck

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.