Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi,

 

How can I make it so that no matter what screen resolution my application runs on, that it resizes the forms and all the controls to work with that resolution.

 

I am so close to getting it out onto the market but this one thing is holding me up.

 

The application was build on 1024 by 768 and needs to run on 800 by 600.

 

Can someone please give me a hand.

 

Thanks.....Dale

Posted

I think with this you'll have some troubles... specially making the controls smaller...

 

The point is that certain controls are not user dimensionable (as long as I know), like the ComboBox for example! You'll allways have to play with the font size.

 

This method brings a new issue... the height of the combobox actualy really changes in integer gaps...

 

If the issue is to have a windows always maximized in diferent resolutions it's a easy task, but if you want to let the user resize the windows freelly you'll have trouble...

Software bugs are impossible to detect by anybody except the end user.
Posted

I didn't read the complete article but what I undestood from it and from what Top Score asked it's not quite the same thing...

 

I think he wants to resize the complete layout, including the font size on the controls... like chaging the size but keeping the aspect ratio...

 

Am I wrong?

 

And that aspect ratio is the thing that brings more troubles... :)

 

If put to work wold be a very nice tool ...!

Software bugs are impossible to detect by anybody except the end user.
Posted (edited)

Hey,

 

I have seen that article a dozen times, I have read through it but it is not exactly what I need, you are right.

 

Yeah the fonts don't need resizing, they may I will just have to check. Although it might be best If I did??

 

But yeah the whole form including the controlls.

 

I have tried other methods like anhoring, when I put in on another computer the form I tested it on just goes blank and every loses its size back down to a small form. And this is a full screen form :confused:

 

And just to confirm it is when the window automatically adjusts to the size of the screen, not for user resizing.

 

I use VB.Net 2002

 

I aggree if this could work then it would fix alot of peoples problems, thats for sure.

 

I await the reply

 

Dale

Edited by Top Score Score
Posted

I really don't know how you'll do this...

 

The only real problem is in the controls that are not sizable...

I told you... the textbox and the combobox are the two better examples! You can't change their height without changing their font size!

 

I think you can ajust the components on 800x600 and 1024x768 and make some kind of ratio to apply to the components sizes to make them grow or shrink with the form size beetwin theese too values... get it?

 

I think its the only way...

Software bugs are impossible to detect by anybody except the end user.
Posted

I think you can ajust the components on 800x600 and 1024x768 and make some kind of ratio to apply to the components sizes to make them grow or shrink with the form size beetwin theese too values... get it?

 

Yeah this is basicaly what i want to do. I am still learning .Net and I am only 16, are you able to give me the sort of code that I could use??

 

Thanks.........Dale

  • 1 month later...
Posted

Resizing with a Ratio

 

I am working on a class that iterates through every control on a form, resizing and repositioning every control. I wouldn't mind a little help in the Font department though. I'm sooo close to finding an equation to universally resize the fonts by breaking the font into it's composite peices ..resizing then reassembling them.

Anyhow to get you pointed in the right direction say you designed the forms in 1024 X 768..and you are going to switch resolution to 800 X 600...1024/800 = 1.28 and 768/600 = 1.28 now you have your 2 ratios for both width and height. You can use these ratios to resize (current height = 100, so 100 / 1.28 = 78.125 <-- your new height) and (top = 548, so 548 / 1.28 = 428.125)...Now as you know sizes often are expressed in floats so you'll have to do quite a bit of casting and numerical conversions..as you'll see when I post my code later. And of course when I refine it I will post it on Winforms.com for your coding pleasure =D.

Posted

I think this should get you started...

It's far from "final version" but will give you something to start!

 

Public Class Form1
   Inherits System.Windows.Forms.Form

#Region " Windows Form Designer generated code "

   Public Sub New()
       MyBase.New()

       'This call is required by the Windows Form Designer.
       InitializeComponent()

       'Add any initialization after the InitializeComponent() call

   End Sub

   'Form overrides dispose to clean up the component list.
   Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
       If disposing Then
           If Not (components Is Nothing) Then
               components.Dispose()
           End If
       End If
       MyBase.Dispose(disposing)
   End Sub

   'Required by the Windows Form Designer
   Private components As System.ComponentModel.IContainer

   'NOTE: The following procedure is required by the Windows Form Designer
   'It can be modified using the Windows Form Designer.  
   'Do not modify it using the code editor.
   Friend WithEvents Label1 As System.Windows.Forms.Label
   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
       Me.Label1 = New System.Windows.Forms.Label
       Me.SuspendLayout()
       '
       'Label1
       '
       Me.Label1.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
                   Or System.Windows.Forms.AnchorStyles.Left) _
                   Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
       Me.Label1.Font = New System.Drawing.Font("Tahoma", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
       Me.Label1.Location = New System.Drawing.Point(32, 32)
       Me.Label1.Name = "Label1"
       Me.Label1.Size = New System.Drawing.Size(136, 24)
       Me.Label1.TabIndex = 0
       Me.Label1.Text = "AlexCode"
       '
       'Form1
       '
       Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
       Me.ClientSize = New System.Drawing.Size(632, 446)
       Me.Controls.Add(Me.Label1)
       Me.MinimumSize = New System.Drawing.Size(640, 480)
       Me.Name = "Form1"
       Me.ResumeLayout(False)

   End Sub

#End Region

   'All the standard resolutions have the same ratio... so a choose one of them
   Dim ratio As Double = 640 / 480     'the result it's = 1,3(3)
   Dim fSize As Single = 8.25!         'This is the start size os the label font

   Private Sub Form1_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Resize

       'Preserve Form ratio... it flicks a bit :(
       'This it's needed because I just couldn't resize the font just horizontally or just vertically
       'it has to be both the same time...
       Me.Height = Me.Width / ratio

       fSize = 8.25! * (Me.Width / 640)

       'To set a new font size you have to set the complete font property...
       Me.Label1.Font = New System.Drawing.Font _
           ("Tahoma", fSize, System.Drawing.FontStyle.Regular, _
           System.Drawing.GraphicsUnit.Point, CType(0, Byte))

   End Sub

End Class

 

 

Feel free to ask anything...

 

and btw, sorry if I didn't reply you but I didn't get your last post on my e-mail...

 

:D give it a shot!

Software bugs are impossible to detect by anybody except the end user.
Posted (edited)

OK as promised here's my super sloppy Resizing Code...I've added a few lines that basically just resizes your text to fit in your controls. This would not be a good idea if your using word wrapping..Most likely you'll want to comment it out. Speaking of comments ..this is a work in progress and I'm not one for inserting comments in my test code. Hope you all can Disect reconnect and resurrect this snippet to serve your resizing needs. When I have completed my code including placing it in a more readable and usefull Class..I'll repost.

//Scales the Form and all controlls, Resolution independant.
	#region Scaling

	private void CallScale()
	{
		if(Screen.PrimaryScreen.WorkingArea.Height != 768 || Screen.PrimaryScreen.WorkingArea.Width != 1024)
		{
			IterateControls(this);	
		}
	}

	private void IterateControls(Control ParentControl)
	{
		foreach(Control ctl in ParentControl.Controls)
		{
			FinanceScale(ctl,112);
			if(ctl.Controls.Count > 0)
			{
				IterateControls(ctl);
			}
		}
	}

	private void FinanceScale(Control Ncontrol, int intModifier)
	{
		double ratioWidth = (double)1024/(double)Screen.PrimaryScreen.WorkingArea.Width;
		double ratioHeight = (double)768/(double)Screen.PrimaryScreen.WorkingArea.Height;
		ratioWidth = ratioWidth * 100;
		ratioHeight = ratioHeight * 100;
				Control ctrl = Ncontrol;
				Application.DoEvents();
		if(ctrl.GetType().ToString() != "System.Windows.Forms.Label" && ctrl.GetType().ToString() != "System.Windows.Forms.Button")
		{
			ScaleBackGround((int)((double)ratioWidth),(int)((double)ratioHeight),ctrl.BackgroundImage,ctrl);
		}
		else
		{
			switch(ctrl.GetType().ToString())
			{
				case "System.Windows.Forms.Label":
					Label lblImg = (System.Windows.Forms.Label)ctrl;
					if(lblImg.Image != null)
					{
						ScaleLabel((int)((double)ratioWidth),(int)((double)ratioHeight),lblImg.Image,lblImg);		
					}
					break;
				
				case "System.Windows.Forms.Button":
					Button btnImg = (System.Windows.Forms.Button)ctrl;
					if(btnImg.Image != null)
					{
						ScaleBackGround((int)((double)ratioWidth),(int)((double)ratioHeight),btnImg.BackgroundImage,btnImg);
					}
					if(btnImg.BackgroundImage != null)
					{
						ScaleButton((int)((double)ratioWidth),(int)((double)ratioHeight),btnImg.Image,btnImg);
					}
					break;
			}
		}
				float fl = (float)ctrl.Font.Size;
				float flNew_emSize = 0;
		if(Screen.PrimaryScreen.WorkingArea.Height <= 768 && Screen.PrimaryScreen.WorkingArea.Width <= 1024 && ratioHeight != ratioWidth)
		{
			flNew_emSize = fl * (float)(ratioWidth /ratioHeight);
		}
		else if(Screen.PrimaryScreen.WorkingArea.Height <= 768 && Screen.PrimaryScreen.WorkingArea.Width <= 1024)
		{
			if(ctrl.GetType().ToString() == "System.Windows.Forms.ComboBox")
			{
				flNew_emSize = ((fl * 100) / (float)ratioHeight) + 5f;
			}
			else
			{
				flNew_emSize = (fl * 100) / (float)ratioHeight;
			}
		}
		else if(Screen.PrimaryScreen.WorkingArea.Height != 768)
		{
			flNew_emSize = fl * (float)(ratioHeight / ratioWidth);
		}
		else
		{
			flNew_emSize = fl;
		}
		//resize controls to get accurate width
		ctrl.Height = Convert.ToInt32(Convert.ToDouble(ctrl.Height*100) / ratioHeight);
		ctrl.Width = Convert.ToInt32(Convert.ToDouble(ctrl.Width*100) / ratioWidth);
		ctrl.Left = Convert.ToInt32(Convert.ToDouble(ctrl.Left*100) / ratioWidth);
		ctrl.Top = Convert.ToInt32(Convert.ToDouble(ctrl.Top*100) / ratioHeight);
	
		ctrl.Font = new Font(ctrl.Font.FontFamily,(float)flNew_emSize,ctrl.Font.Style);
		if(ctrl.Text != "")
		{
			Brush b = Brushes.Black;
			string s = ctrl.Text;
			while(((float)s.Length * ctrl.Font.Size) > ctrl.Width)
			{
				ctrl.Font = new Font(ctrl.Font.FontFamily,ctrl.Font.Size - 1,ctrl.Font.Style);
			}
			IntPtr ptr = ctrl.Handle;
			Graphics g = Graphics.FromHwnd(ptr);
			g.TextRenderingHint = TextRenderingHint.AntiAlias;
			g.DrawString(s,ctrl.Font,b,ctrl.ClientRectangle);
		}
			

	}
	#endregion

public static void ScaleLabel(int RatioWidth,int RatioHeight,Image imImage, Label lblImage)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			lblImage.Image = TargetBitmap;
		}
	}

	public static void ScaleButton(int RatioWidth,int RatioHeight,Image imImage, Button btnImage)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			btnImage.Image = TargetBitmap;
		}
	}

	public static void ScaleBackGround(int RatioWidth, int RatioHeight,Image imImage, Control ctrl)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			ctrl.BackgroundImage = TargetBitmap;
		}
	}

Edited by PlausiblyDamp
Posted
P.S. I place this code in my constructor of my form..it should detect the current screen size excluding your Task bar and any other utility bars i.e. MSOffice bar etc..I don't suggest ever calling this code from a paint event as it will most likely cause an infinite loop or other unexpected results
Posted
Any questions or comments ,other than why I have posted 4 times in a row when I could have obviously included everything in one post ;)~, are welcome. SIA If I don't always have time to reply to questions
Posted

For your question about the Drutchlin code being .net or not I think you'll have some huge problems understanding it! :D

 

Anyways... It's C# code! And place it where you usually put your Subs and Functions... It isn't Design Generated code...

Software bugs are impossible to detect by anybody except the end user.
Posted
That's right it is C#.. you should be able to use most of the functionality if you convert it into VB ...I have almost finished a class...all you'll have to do is reference it create an instance and call a method..I will try to have it up in a couple of days
Posted

There's really some convertors but if you know vb you know C#...

It's just a matter of learning few declaration diferences... a good thing about learning that diferences is that you'll learn another language...

 

Second thing is that the convertors aren't fail prof...

Software bugs are impossible to detect by anybody except the end user.
  • 2 months later...
Posted
Hey Drutchlin, Was just wondering if you had an opportunity to post the class for resizing a windows form based on screen resolution. In your earlier posts you had mentioned that you were working on a class and would post it in couple of days. Instead of reinventing the wheel if you have one already finished was thinking of using it. Thanks a lot!!
Posted

Sorry all...I've been very busy at work trying to rush product to the market. As soon as things slow down I'll finish up the class. I have a VB app that also needs the activeX control..I've still yet to study up on interopt to create the activeX control...I do have a C# class already complete..if you would like I could post it ..let me know. the font resizing is still a little quirky..if anyone has any solid info on resizing fonts..I would be greatly in your debt. Fonts are tricky as they are made up of variuos elements..and also depend on dpi. http://www.hut.fi/u/hsivonen/units.html and

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdicpp/GDIPlus/UsingGDIPlus/UsingTextandFonts.asp

 

TIA

Posted
I would appreciate it if you can post the C# class. I am afraid I may not be of much help with the fonts but I will try to play with your class and search over the web also to find some pointers. Thanks a lot!!
Posted (edited)

Copy this code out place in a new class name it Resize. See the comment below place the name space of your project name in place of the comment. Compile as a dll..reference your dll...create an instance of the class and simply call CallScale(this)..passing this, meaning your form, as the control...it will iterate through all controls on your form..including controls contained in other container controls. In the code resizing the fonts you'll notice a 5f..this float can be played with a bit to get different results..If you've any questions please reply!

using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace //Place your NameSpace here!!
{
/// <summary>
/// Summary description for Resize.
/// </summary>
public class Resize
{
	public Resize()
	{
		//
		// TODO: Add constructor logic here
		//

	}

	//Scales the Form and all controlls, Resolution independant.
	#region Scaling

	public void CallScale(Control m_Ctrl)
	{
		if(Screen.PrimaryScreen.WorkingArea.Height != 768 || Screen.PrimaryScreen.WorkingArea.Width != 1024)
		{
			IterateControls(m_Ctrl);	
		}
	}

	private void IterateControls(Control ParentControl)
	{
		foreach(Control ctl in ParentControl.Controls)
		{
			ScaleForm(ctl);
			if(ctl.Controls.Count > 0)
			{
				IterateControls(ctl);
			}
		}
	}

	private void ScaleForm(Control Ncontrol)
	{
		double ratioWidth = (double)1024/(double)Screen.PrimaryScreen.WorkingArea.Width;
		double ratioHeight = (double)768/(double)Screen.PrimaryScreen.WorkingArea.Height;
		ratioWidth = ratioWidth * 100;
		ratioHeight = ratioHeight * 100;
		Control ctrl = Ncontrol;
		Application.DoEvents();
		if(ctrl.GetType().ToString() != "System.Windows.Forms.Label" && ctrl.GetType().ToString() != "System.Windows.Forms.Button")
		{
			ScaleBackGround((int)((double)ratioWidth),(int)((double)ratioHeight),ctrl.BackgroundImage,ctrl);
		}
		else
		{
			switch(ctrl.GetType().ToString())
			{
				case "System.Windows.Forms.Label":
					Label lblImg = (System.Windows.Forms.Label)ctrl;
					if(lblImg.Image != null)
					{
						ScaleLabel((int)((double)ratioWidth),(int)((double)ratioHeight),lblImg.Image,lblImg);		
					}
					break;
				
				case "System.Windows.Forms.Button":
					Button btnImg = (System.Windows.Forms.Button)ctrl;
					if(btnImg.Image != null)
					{
						ScaleBackGround((int)((double)ratioWidth),(int)((double)ratioHeight),btnImg.BackgroundImage,btnImg);
					}
					if(btnImg.BackgroundImage != null)
					{
						ScaleButton((int)((double)ratioWidth),(int)((double)ratioHeight),btnImg.Image,btnImg);
					}
					break;
			}
		}
		float fl = (float)ctrl.Font.Size;
		float flNew_emSize = 0;
		if(Screen.PrimaryScreen.WorkingArea.Height <= 768 && Screen.PrimaryScreen.WorkingArea.Width <= 1024 && ratioHeight != ratioWidth)
		{
			flNew_emSize = fl * (float)(ratioWidth /ratioHeight);
		}
		else if(Screen.PrimaryScreen.WorkingArea.Height <= 768 && Screen.PrimaryScreen.WorkingArea.Width <= 1024)
		{
			if(ctrl.GetType().ToString() == "System.Windows.Forms.ComboBox")
			{
				flNew_emSize = ((fl * 100) / (float)ratioHeight) + 5f;
			}
			else
			{
				flNew_emSize = (fl * 100) / (float)ratioHeight;
			}
		}
		else if(Screen.PrimaryScreen.WorkingArea.Height != 768)
		{
			flNew_emSize = fl * (float)(ratioHeight / ratioWidth);
		}
		else
		{
			flNew_emSize = fl;
		}
		//resize controls to get accurate width
		ctrl.Height = Convert.ToInt32(Convert.ToDouble(ctrl.Height*100) / ratioHeight);
		ctrl.Width = Convert.ToInt32(Convert.ToDouble(ctrl.Width*100) / ratioWidth);
		ctrl.Left = Convert.ToInt32(Convert.ToDouble(ctrl.Left*100) / ratioWidth);
		ctrl.Top = Convert.ToInt32(Convert.ToDouble(ctrl.Top*100) / ratioHeight);
	
		ctrl.Font = new Font(ctrl.Font.FontFamily,(float)flNew_emSize,ctrl.Font.Style);
		if(ctrl.Text != "")
		{
			Brush b = Brushes.Black;
			string s = ctrl.Text;
			while(((float)s.Length * ctrl.Font.Size) > ctrl.Width)
			{
				ctrl.Font = new Font(ctrl.Font.FontFamily,ctrl.Font.Size - 1,ctrl.Font.Style);
			}
			IntPtr ptr = ctrl.Handle;
			Graphics g = Graphics.FromHwnd(ptr);
			g.TextRenderingHint = TextRenderingHint.AntiAlias;
			g.DrawString(s,ctrl.Font,b,ctrl.ClientRectangle);
		}
			

	}

	public static void ScaleLabel(int RatioWidth,int RatioHeight,Image imImage, Label lblImage)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			lblImage.Image = TargetBitmap;
		}
	}

	public static void ScaleButton(int RatioWidth,int RatioHeight,Image imImage, Button btnImage)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			btnImage.Image = TargetBitmap;
		}
	}

	public static void ScaleBackGround(int RatioWidth, int RatioHeight,Image imImage, Control ctrl)
	{
		if(imImage != null)
		{
			//int ScaleValue = Ratio;
			Bitmap SourceBitmap = new Bitmap(imImage);
			Bitmap TargetBitmap = new Bitmap((SourceBitmap.Width * 100) / RatioWidth,(SourceBitmap.Height * 100)/RatioHeight);
			Graphics bmpGraphics = Graphics.FromImage(TargetBitmap);
			//Set Drawing Quality
			bmpGraphics.InterpolationMode = InterpolationMode.Bicubic;
			bmpGraphics.SmoothingMode = SmoothingMode.AntiAlias;

			Rectangle compressionRectangle = new Rectangle(0, 0, ((SourceBitmap.Width * 100) / RatioWidth), ((SourceBitmap.Height * 100) / RatioHeight));
			bmpGraphics.DrawImage(SourceBitmap, compressionRectangle);
			ctrl.BackgroundImage = TargetBitmap;
		}
	}
	#endregion

}
}

Edited by PlausiblyDamp
Posted
One more thing...this class if you've noticed...was designed to resize FROM 1024 X 768...If you have designed your application in another resolution simply replace all occurances of 1024 and 768 with the correct resolution

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...