Click here to Skip to main content
15,888,461 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: How to add properties to TreelistView User control Pin
mlauahi1-May-06 12:27
mlauahi1-May-06 12:27 
Questionprinting more than one report in CR Pin
microuser_200028-Apr-06 23:58
microuser_200028-Apr-06 23:58 
QuestionHow to Write a Vertical Text In Graphic Mode in VB.NET Pin
alialikh28-Apr-06 20:54
alialikh28-Apr-06 20:54 
AnswerRe: How to Write a Vertical Text In Graphic Mode in VB.NET Pin
Ed.Poore28-Apr-06 23:38
Ed.Poore28-Apr-06 23:38 
GeneralRe: How to Write a Vertical Text In Graphic Mode in VB.NET Pin
alialikh29-Apr-06 1:58
alialikh29-Apr-06 1:58 
QuestionResizing Images in VB.Net Pin
JoeySmith28-Apr-06 14:36
JoeySmith28-Apr-06 14:36 
AnswerRe: Resizing Images in VB.Net Pin
Yuvi Panda28-Apr-06 20:15
Yuvi Panda28-Apr-06 20:15 
AnswerRe: Resizing Images in VB.Net Pin
Bhanwar Gupta28-Apr-06 20:40
Bhanwar Gupta28-Apr-06 20:40 
hai there,
i had made a project on wallpaper changer, and it is working very well.
the code

PictureBox6.Image = img5.GetThumbnailImage(117, 121, Nothing, Nothing)

will made the picturebox as thumbnail of the size demanded.
and if you wnat to make the size of the picture according to the resolution ofthe desktop than check this out....










private static void ConvertSourceFileToBmp(string sourceFilePath, string tempBmpFilePath, ScaleStyles scaleStyle, Color backColor)
{
Image sourceImg = Image.FromFile(sourceFilePath);
if (scaleStyle != ScaleStyles.BestFit)
{
sourceImg.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp);
}
else
{
//get the dimensions of the screen
float H = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
float W = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;

//get the image dimensions
float h = sourceImg.Height;
float w = sourceImg.Width;

//dimensions of target
float targetHeight = -1;
float targetWidth = -1;

//find the appropriate height and width
if (H / h >= W / w)
{
targetWidth = w;
}
else
{
targetHeight = h;
}
if (targetHeight == -1)
{
targetHeight = (H / W) * targetWidth;
}
if (targetWidth == -1)
{
targetWidth = (W / H) * targetHeight;
}

//create a new image with the default back color with the scaled dimensions w.r.t. image and screen
Bitmap bmpImage = new Bitmap((int)targetWidth, (int)targetHeight);
Graphics g = Graphics.FromImage(bmpImage);
SolidBrush backgroundColorBrush = new SolidBrush(backColor);
g.FillRectangle(backgroundColorBrush, 0, 0, bmpImage.Width, bmpImage.Height);

//layout this image in the center
g.DrawImage(sourceImg, Math.Abs(targetWidth-sourceImg.Width)/2, Math.Abs(targetHeight - sourceImg.Height)/2, sourceImg.Width, sourceImg.Height);

//save it as bmp
bmpImage.Save(tempBmpFilePath, System.Drawing.Imaging.ImageFormat.Bmp);

//dispose stuff
backgroundColorBrush.Dispose();
g.Dispose();
bmpImage.Dispose();

}
sourceImg.Dispose();
}

private static void SetRegistryKeyForWallpaper(string keyName, string value)
{
RegistryKey deskTopKey = Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
deskTopKey.SetValue(keyName, value);
deskTopKey = null;
}


if this could'nt help you,plz let ne know your problem in detail,and what actually yo want to do.
waiting for ur reply...
bhanwar
bhanwargupta@gmail.com
GeneralRe: Resizing Images in VB.Net Pin
JoeySmith29-Apr-06 0:50
JoeySmith29-Apr-06 0:50 
QuestionVirtual KeyCode to ASCII Pin
daveime28-Apr-06 12:33
daveime28-Apr-06 12:33 
QuestionHow to connect VB6 to MSExel Pin
Jijo thomas28-Apr-06 9:12
Jijo thomas28-Apr-06 9:12 
AnswerRe: How to connect VB6 to MSExel Pin
Garner T29-Apr-06 17:36
Garner T29-Apr-06 17:36 
Questiondatarow array Pin
G7236028-Apr-06 9:08
G7236028-Apr-06 9:08 
GeneralRe: datarow array Pin
Guffa28-Apr-06 10:22
Guffa28-Apr-06 10:22 
GeneralRe: datarow array Pin
G7236028-Apr-06 10:31
G7236028-Apr-06 10:31 
QuestionDeveloping Torrent Client Pin
DH Julio28-Apr-06 6:31
DH Julio28-Apr-06 6:31 
AnswerRe: Developing Torrent Client Pin
progload28-Apr-06 9:49
progload28-Apr-06 9:49 
GeneralRe: Developing Torrent Client Pin
DH Julio29-Apr-06 8:41
DH Julio29-Apr-06 8:41 
GeneralRe: Developing Torrent Client Pin
progload29-Apr-06 13:00
progload29-Apr-06 13:00 
Questionthis is abt Nbaiss Pin
Mohammed Amine28-Apr-06 5:05
Mohammed Amine28-Apr-06 5:05 
Questionplease can you separate them ??Date & time Pin
Mohammed Amine28-Apr-06 5:01
Mohammed Amine28-Apr-06 5:01 
AnswerRe: please can you separate them ??Date & time Pin
mr_1234528-Apr-06 5:06
mr_1234528-Apr-06 5:06 
GeneralRe: please can you separate them ??Date & time Pin
Mohammed Amine28-Apr-06 5:07
Mohammed Amine28-Apr-06 5:07 
QuestionTRANSFER VIDEO.AVI Pin
izzah_mustapha28-Apr-06 4:36
izzah_mustapha28-Apr-06 4:36 
QuestionLogon to system Pin
nitin_ion28-Apr-06 2:27
nitin_ion28-Apr-06 2:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.