473,385 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

background problem saving Gif files in VB2005

When saving a gif file in VB 2005 with a custom brush color the background
if the image is dithered. When I save the image as any other type but gif
the background is not dithered. What can I do to fix this?

Below is my code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim outstr As String = "REDUCED - Ralph Lauren 2T pants new"
Dim myfontstyle As FontStyle = FontStyle.Bold + FontStyle.Underline
Dim outfont As Font = New Font("ARIAL", 10, myfontstyle)
Dim bmp As Bitmap = New Bitmap(456, 100)
Dim canvas As Graphics = Graphics.FromImage(bmp)
Dim mycolor As Color = Color.FromArgb(255, 213, 218, 219)
Dim mybrush As SolidBrush = New SolidBrush(mycolor)
canvas.FillRectangle(mybrush, 0, 0, 456, 100)
canvas.DrawString(outstr, outfont, Brushes.Blue, 10, 10)
bmp.Save("c:\mytest.gif", System.Drawing.Imaging.ImageFormat.Gif)
End Sub

Thanks,
pete
Mar 8 '06 #1
0 950

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: sunilj20 | last post by:
Hello, I have a requirement wherein, a user clicks on a file name in an ASP.NET web application, and the file should automatically be downloaded (Without showing the "Open", "Save As") in the...
1
by: Rich | last post by:
I have a simple vb2005 app (for testing). It is just a simple winform with one button that brings up a message box. When I invoke the app and click on the button, the message box comes up OK. ...
4
by: Pedro Leite | last post by:
Good Afternoon. the code below is properly retreiving binary data from a database and saving it. but instead of saving at client machine is saving at the server machine. what is wrong with my...
11
by: Kevin | last post by:
I've been searching forever for examples of saving data changes in a DataGridView. There's all kinds of examples, but none really show how to save changes. Someone please help me. I have a...
5
by: Dennis | last post by:
I am thinking of getting VB2005 to replace my VB2003 but don't like the idea of having two files for one form (I have enough files on my computer as it is). Is there any way to have VB2005 act...
10
by: suzie4656 | last post by:
I know it's probably just a setting. We have Internet Explorer 7 and are running Windows XP. When I noticed the background color was missing, I was searching the internet and saving different .gif...
0
by: Waqas.L.Khan | last post by:
Hi guys, I have a problem when trying to create an image file. Basically my code takes any file and gets it's system icon using SHGetFileInfo and then saves the file either by converting it into...
1
by: reessm01 | last post by:
Hello, I'm a bit new with VB2005 (learned it in college recently) Anywho. I've saved it as an .exe file, but now I want to go back and make prerequisites so that this file can, in theory, be...
5
by: =?Utf-8?B?S3VsYmVy?= | last post by:
I feel my delay. I had work. First of all, thank you for reply. I explain: I do not know use the code of the original web page in VB.NET. Gillard made the translation from C (and thank you)...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.