Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

idea needed: estimating size

Status
Not open for further replies.

eramgarden

Programmer
Aug 27, 2003
279
0
0
US
I'm processing an image by putting it o 500x700 ackground canvas... I like to know how I can tell where the image ends so i could insert a text below it ..something like height of the image..This is what I have ..images ca be of different heights and this isnt workig right:

Code:
        Dim b As New Bitmap(strFileToConvert)
        Dim Canvas As New Bitmap(500, 700) 

        Dim g As Graphics = Graphics.FromImage(b)
        Dim gr As Graphics = Graphics.FromImage(Canvas)

           ..... 
        'get size of the image
        Dim ImageHieght = b.Height()
        Dim CanvasHeight = Canvas.Height() 

       ..... [b] find where image ends [/b]
    
       
        Canvas.Save(strFileToConvert + ".jpeg", System.Drawing.Imaging.ImageFormat.Jpeg)
        Canvas.Dispose()
 
You can't look at g.ClipBounds, which returns you the clipping rectangle (which contains a Height property)?

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top