Does anyone know of a solution for writing text to an image using an OTF? I know that GDI+ does not support OTF and that WPF does. I can load the font as a label in WPF, but still do not know how I can write this over an image, such as a watermark would do, and save that image.
I need this in an ASP.net page, so I won't actually be able to use WPF, but I figure that might be a start in building a class my page can import.
Please Correct me if I have posted this in the wrong forum, I have a relatively simple question, I'm looking for a way to use Non-True type fonts in Visual basic. Specifically in a Forms app, and I'm looking to use said fonts in a Non-User Input object. (Label) If it helps, I'm looking to use Some Adobe Fonts such as Myraid Pro.
I try to use a special font in my programm xxxxxx.ttf (true type font)and i got this error "only tryetype fonts are supported .this is not a true type font "i used it before with same programm but since i installed a very old version of xp i got the error.
Using XP and VB 2008 Express for development of Widows Forms App.I am setting a button's .text to "" and then assigning a bitmap with some text written on it to the button's .image. Everything looks great on the development compter, but is almost unreadable on test computers using Vista and Windows 7. This despite trying a number of different combinations of (standard?) font family and size (including Arial, Verdana, Microsoft Sans Serif). Why?
Details....I have a button on a form (32 pixels x 32 pixels).I set the button.text field to "". I create a bitmap a little smaller than the button, and DrawText on it (I can't simply use the button.text field because I want to place text in different areas of the button and draw special characters.I use the following code to create the bitmap:
m_bmpDrawingSurface = New Bitmap(30, 30, Drawing.Imaging.PixelFormat.Format32bppArgb) Dim objGraphics As Graphics objGraphics = Graphics.FromImage(m_bmpDrawingSurface)[code]...
I wonder if somehow fonts are being anti-aliased or otherwise cleaned up by the system on the development computer, but not on the other computers. I also wonder if I should be creating just a simple 30 pixel x 30 pixel bitmaps, or perhaps should be trying somehow to get the buttons 'device context' or something. Or, is there an alternative to DrawString that draws text more intelligently than just setting the nearest pixel either black or transparent, which is what seems to be happening (ie, no anti-aliasing or creation of shades of gray). Maybe another pen? Is there an "anti-aliasing" pen?
i am using VS 2008 and just started to work with XAML and WPF. while opening in page(.xaml) in design mode i'm getting the error like this "Only TrueType fonts are supported and this is not a TrueType font".
I have a generic Class I'm using to hold information loaded from a database.I have a method which takes a DataRow as an argument, uses the object's known column name and extracts the data from the DataRow, such that:Dim loadData As T = CType(myDataRow("myColumnName"), T))works as my default assignment in most cases.Unfortunately, due to some horrifying design constraints, some of my columns may be null, and may also be taken from enumerations.This means that when <T> is Nullable(Of SomeEnumeration) the above code does not work because I can't cast 0 directly to SomeEnumeration.Zero.Is there some way to check whether <T> is Nullable(Of [Enum])? Or some way to write a method which allows Integers to be cast to Nullable(Of [Enum])?I feel like I'm forgetting something that would allow me to write one of the other of these, but my weak google-fu is turning up nothing.
EDIT: Okay, thanks to dasblinkenlight's answer below, I can detect when this circumstance is occurring, but what I need to do now is to take a type <T> which I know is Nullable(Of SomeClass), get a type reference to SomeClass and then create a new object of type Nullable(Of SomeClass) and assign that to LoadData.My problem was that I had a lot of difficulty in finding any function which would accept baseType as an actual Type.Parse accepted baseType as a parameter, I knew baseType was an [Enum] type because of dasblinkenlight's code, so I was, in this instance, able to code a solution. It's a solution which is very specific to my problem (i.e., T is Nullable(of SomeEnumeration)), but it's a solution nonetheless.
I am trying to edit an image. I can open the image with Picturebox1.load(mypicture)
I can change the pixels/edit the picture by Dim img as new bitmap(picturebox1.image)
[Code]...
now here is the weird part. When I save the image the filesize INCREASES..but the picture dimensions are the same Example... TEST.PNG 1.3KB, when opened up via picturebox/saved the image is now 2.3KB
not sure why...i even though I specify system.drawing.imaging.imageformat.PNG
samething with JPG... it actually SHRINKS it evenmore.. example 88KB jpeg.. saved as jpeg is now 47.7KB...
Dim Button As ToolStripButton = New ToolStripButton Button.image = Icon.ExtractAssociatedIcon(exefile)
I try that code, and it just throws me the error that type Icon cannot be converted to Image. So how do i get around this? And does "ExtractAssociatedIcon(exefile)" work on exe files? Admittedly i don't really know what im doing
Dim Button As ToolStripButton = New ToolStripButtonButton.image = Icon.ExtractAssociatedIcon(exefile)I try that code, and it just throws me the error that type Icon cannot be converted to Image.So how do i get around this? And does "ExtractAssociatedIcon(exefile)" work on exe files?
I have the following code that gets a jpg image from sql which works fine.What i would now like to do is save this image as a file on my pc in a temp folder that i can use in a report. i would like to change the name of this image to the sheltercode.below is the code that i use to get the image from the sql table and populate into a picture box on my form. conn.Open() [code]
I am using VB2008 in VS Prof and try to convert at Byte arry stored as a Image format in Sql2000 database.
Code: Using acnLoc As New SqlConnection(CSLoc) acnLoc.Open() Dim G As SqlCommand = New SqlCommand("SELECT [SignatureData] FROM [MyTable] where [OID]=@OID", acnLoc) G.Parameters.Add("@OID", SqlDbType.Int).Value =Cint(bxShipmentno.Text.Trim()) dim P= G.ExecuteScalar() 'returns a system arry
I have an application that works in both 32 and 64 bit, except that on the 64 bit system it can not open/ read/write any files.I know the 64bit file system is different, from what I heard. How can I make up for the changes? I have no access to a 64bit system, but I want to make my program able to find and open the files.
So I want my program to open up an empty notepad window, and then fill it in and let the user save it as whatever they want. Is this possible in VB .NET, and if so, do you have any pointers? Note: I don't want to save to write to a file and then save it. I know how to do that. I want to write to a notepad window (an unsaved file). I hope this makes sense and I hope it's possible.
I would like write Date and Time from Now() To field fDT in Table Tbl MS Access 2007 but I can't: msAccessConnection.Execute("INSERT INTO Tbl (fDT) VALUES ('" & DateTime.Now & "')")
I have a program that reads images from my access database. What I'm trying to do now is write the images out to a folder but I don't know where to begin. The "ms" variable holds the images.
I see more than a few questions asking how to read metadata from an image, but I haven't seen as many asking how to write metadata. Basically, I need to add one item of metadata ("ImageDescription") to a PNG image I'm generating dynamically (creating a Bitmap object and procedurally generating all the content in it).
What would be the best way to add metadata to an image with .NET either before or just after writing the file to disk?
How could I load an Image from my computer and write on the picture using VB.net [ 2008 ]. Then text will show only when the mouse is hovered on the location where text is written. I want to write down the location of the picture for say.
i want to write a program and set it as default to open .txt files so when i double click on a text file that it opens in that program and displays the text into a RichTextBox
my question is how do i display the text in the RichTextBox after opening the program through a double click on a text file?
I am attempting to write a programme where a user can type in a 'string' into a textbox. A data dictionary will contain specific keywords relating to a specific classification, where an algorithm can detect whether any of the keywords occur in the 'string'. Here are the processes that need to occur:
1) A data dictionary, that contains keywords relating to specific classes eg. (IT Issues, Printer, Software, Password).
2) An algorithm needs to compare the words in the Data Dictionary to that of the 'string' to detect any matches.
3) A rule set to determine what classification the 'string' needs to be classed as.
I am using Visual Basic 2010 Express and attempting to get information on how to Open, Close, Read and Write a disk file in Windows using VB. I have attempted to use help on the home page of Visual Basic 2010 Express with no results. It does not give me any instruction or sample.
I need open excel sheets in an application write in VS2008 (VB.NET) and Windows 7 as OS. All seem work fine, but I don't see excel worksheet. I see Excel32 opened as process, but no window on my screen. The code I used id this:
Let's say, when you click a button it just opens a specified .txt file and adds the data of it to a listbox. I mean automatically, without that file opening dialog showing?
Been trying to get somewhere with this in another thread, but no such look, just keep getting reffered back to the same documentation... If I understood the documentation, I would have fixed it by now:
vb.net Private Sub MakeiSuitePwdFile() Dim text As String =
I am trying to write a simple program which will simply have buttons to open spreadsheets, and a search facilities to look for spreadsheets with a title which is an invoice number. I have my basic forms layed out, all a need now is help with the code.
I am using Visual Basic 2008 Express, and just need a line of code for a button to open an application/spreadsheet. Also, is it possible to have a search box open a file automatically?