Results 1 to 4 of 4

Thread: [2005] want Help in generating random images

  1. #1

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    40

    Exclamation [2005] want Help in generating random images

    hello all,
    i m facing a problem in generating random images...
    a ctually i wish to embade random text in certain image, for that i m using supporte methods by 'Image' type.. i m getting the result fine. but the problem is that i am not able to rotate the text any how.i am getting the staight forward text written in the image. instead of that i want something like this... [IMG]C:\Random1.jpg[/IMG]
    Attached Images Attached Images  
    Last edited by sakeeb; Feb 14th, 2007 at 11:46 AM.

  2. #2

    Thread Starter
    Member
    Join Date
    May 2006
    Posts
    40

    Re: [2005] want Help in generating random images

    sorry for the image tag. i wish i could show the sample image there ... but no prob. i hope the text could explain the scenario

  3. #3
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Re: [2005] want Help in generating random images

    What u can do is for each string do random rotation using
    RotateTransform function

    Enjoy..

    VB Code:
    1. Imports System.Drawing
    2. Imports System.Drawing.Imaging
    3. Imports System.Drawing.Drawing2D
    4.  
    5. // Windows Generated Code
    6.  
    7.     Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    8.         Response.Clear()
    9.  
    10.       Dim bmpimage As New Bitmap(250, 50, PixelFormat.Format24bppRgb)
    11.         Dim objimage As Graphics = Graphics.FromImage(bmpimage)
    12.         objimage.SmoothingMode = SmoothingMode.HighSpeed
    13.         objimage.Clear(Color.LightGreen)
    14.  
    15.         objimage.TranslateTransform(29, 15)
    16.        [B] objimage.RotateTransform(23, MatrixOrder.Prepend)[/B]        objimage.DrawString("p", New Font("Tahoma", 14, FontStyle.Regular), SystemBrushes.WindowText, New PointF(0, 0))
    17.  
    18.         objimage.RotateTransform(-40, MatrixOrder.Prepend)
    19.         objimage.DrawString("A", New Font("Tahoma", 14, FontStyle.Regular), SystemBrushes.WindowText, New PointF(8, 0))
    20.  
    21.         bmpimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    22.         objimage.Dispose()
    23.         bmpimage.Dispose()
    24.  
    25.         Response.End()
    26.     End Sub
    27.  
    28. End Class
    Last edited by Coool; Feb 15th, 2007 at 11:26 PM.
    I am using .NET 2010 with Windows 7

  4. #4
    Hyperactive Member Coool's Avatar
    Join Date
    Feb 2006
    Location
    System.Coool
    Posts
    333

    Re: [2005] want Help in generating random images

    Ok here I am attaching one example ... good point to start but still needs lots of improvement.. (Lots of random variable declared, unncessary inner class)

    Btw, if u improve it plz attach improved code...
    Attached Files Attached Files
    I am using .NET 2010 with Windows 7

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width