|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Graphics Arrggghhh!I got around my previous problem by creating a bitmap references to a graphic where I draw my string, I then set the image of the picture box to the bitmap. This works, although it's a little clumbsy, I now have reference to 15 of each in code, couldn't see a way to dynamically create the objects with the dymanically created picture boxes. Never mind, I can cope with this for the time being. I'm now stuck with getting the dimensions of the DrawString result. As I'm creating the Bitmap objects before anything happens I have to give them dimensions. I then draw my string, say, on a 500 x 500 bitmap. But, I need to reduce the size of the bitmap or picture box to the size of the DrawString result. Any ideas? Cheers, Tull. Trying to understand what you are doing. Would this be correct?
Public Class MyControl Inherits System.Windows.Forms.Panel ' somewhere in your code Dim gr as Graphics = CreateGraphics Dim z as SizeF = gr.Measurestring(mytext, font) gr.Dispose Dim bmp as Bitmap(cint(z.Width),cint(z.Height)) gr = Graphics.FromImage(bmp) gr.DrawString(mytext, font) gr.Dispose BackGroundImage = bmp
A Question on VB Classes
Controls of a form convert html string into a html document Web.config issue buttons stopped working Create a Folder - Newbie Question Reference to a non-shared member requires an object reference Reading logon/logoff datetime User TreeView datagridview update with dataset and dataasapter |
|||||||||||||||||||||||