PDA

Click to See Complete Forum and Search --> : .NET is driving me .NUTS


Radar
Nov 4th, 2001, 10:27 PM
Is it just me or is .NET missing alot of useful properties in its intrinsic controls as compared to VB. For example, I can't seem to find a replacement for the PaintPicture method for the .NET picturebox. Also no AutoRedraw property. or ScaleMode for custom scales. I know that some of these can be overcome with API calls, but they are still quite handy. Any thoughts?

Joacim Andersson
Nov 5th, 2001, 03:14 AM
No you will sertanly not found any of those method you've mentioned.
There is also no Line, PSet, Scale or Circle functions.
All graphic function have been rewritten for VB.Net.
So forget everything you know about graphic output, including most of what you know about working with bitmaps.

You mentioned the API. If you are accustomed to using Win32 API calls for graphic operation then forget everything you know ...
Just kidding!! :)
You're actually in luck, 'cause you'll be able to get up to speed very quickly with the new graphic environment.

To load bitmaps you use the System.Drawing.Bitmap object.Dim bm As New System.Drawing.Bitmap("c:\winnt\zapotec.bmp")
Dim g As Graphics = Graphics.FromHwnd(PictureBox1.Handle)

g.DrawImage(bm, 0, 0)
g.Dispose() 'dispose the objects
bm.Dispose() Best regards