Last post Sep 19, 2008 11:56 PM by saudsami
Jan 07, 2008 05:19 AM|impathan|LINK
I need to make transparent image in png format.
Actually I am working on Live Image Editor.I have a problem to ganerate text image and make it transparent.I tried to generate text image in gif format and I was success but did not get clearity of image.I decided to create image in png format but in this
case I can not make it transparent.
Please can anybody help me regarding this?
Jan 27, 2008 03:51 AM|kronass|LINK
Hello I Faced This problem and I solved it By creating a blank PNG image with fixed size and then load it in the code and write what ever I want to then save it (Note that the blank PNG background is transparent)
This is the code I used to make this operation
Dim MyFont As New Font("Arial", 9)
Dim Position As New PointF(5.0F, 5.0F)
Dim PNGimage As System.Drawing.Image
PNGimage = Image.FromFile(Server.MapPath("BlankImage.png"))
Dim graphics As Graphics
graphics = graphics.FromImage(PNGimage)
graphics.DrawString("test", MyFont, Brushes.Black, Position)
I hope this is helpful to you
Sep 19, 2008 11:56 PM|saudsami|LINK
I am facing the same problem. While the solution posted by kronass does work, it only produces an output image with the same dimensions as the input. My output image will be of a different dimension every time. Can this code be modified to achieve that?
Is there an alternate way of generating transparent PNG with GDI+?
transparent image's problem for gif format
CSS GDI GDI+ background image div rounded corners gradient LinearGradientBrush
drawing in asp.net