473,799 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PictureBox : Zooming without anti-aliasing

I have an app where I want to show an icon in a large PictureBox.
I've set the SizeMode to Zoom but the icon image is extremely fuzzy because
the scaling up also anti-aliases. Is there a way to turn the anti-aliasing
off so I get a nice blocky icon image?

--

"I have nothing but the greatest respect for other peoples' crackpot
beliefs".
-- Sam the Eagle.

Jun 27 '06 #1
1 11656
There's nothing built-in to PictureBox to change the way scaling of images is
performed. You would have to create your own PictureBox-derived class and
override OnPaint(). You could try simply setting Graphics.Interp olationMode
to Low. e.g.
protected override void OnPaint(PaintEv entArgs pe)
{
pe.Graphics.Int erpolationMode =
System.Drawing. Drawing2D.Inter polationMode.Lo w;
base.OnPaint(pe );
}

--
http://www.peterRitchie.com/
"John" wrote:
I have an app where I want to show an icon in a large PictureBox.
I've set the SizeMode to Zoom but the icon image is extremely fuzzy because
the scaling up also anti-aliases. Is there a way to turn the anti-aliasing
off so I get a nice blocky icon image?

--

"I have nothing but the greatest respect for other peoples' crackpot
beliefs".
-- Sam the Eagle.

Jun 27 '06 #2

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

Similar topics

0
1537
by: Gopi | last post by:
Hi All I have set a BackgroundImage for windows forms and i need to implement the image zooming feature for the form ie when ever i m zooming in or zooming out the form the corrosponding background image also needs to be zoomed in and zoomed out. the zoom factors ( zooming values are) 50%,100% and 150% how do i implement this? thanks in advance Gopi
3
3627
by: cdj | last post by:
Hi all, I've got a picturebox on a form, and a save button. When I go to save, the app craps out with the following error: ================== An unhandled exception of type 'System.Runtime.InteropServices.ExternalException' occurred in system.drawing.dll
7
17491
by: Randy Vande Hei | last post by:
Does anyone know how to change the the GDI+ coordinate system like you used to be able to do in VB6 with the picturebox.scale method. The picturebox.scale method took an x,y point defining the upper left corner and a second x,y point defining the lower right corner. In VB6 the 0,0 location was the upper left like in GDI+, but I could at least reset it so I could use it with lat/lons. Basically all I want to do is be able to use the...
1
3356
by: M West | last post by:
continuation of my previous post, thanks to all those that contributed with answers I am creating a control that will take an image and make parts of it transparent, this is done by creating and then applying a region to the control. The control inherits from picturebox and works fine when loading the image into the control, the problem that I am having now is, once the control is loaded and the image is displayed, if the user resizes...
2
4884
by: Just Me | last post by:
I do the following where sss is a string equal to a filename. PictureBox.Image = = New Bitmap(sss) It occurred to me that the file will be locked until the picturebox is disposed at the program end. Would it make more sense to use DrawImage. I mean, is that what programmers typically do?
3
2374
by: b747_440 | last post by:
Hello Newsgroup, I try to resize and move a picturebox. However, after each operation the picture box is being redrawn. This causes flickering. Is it possible to suppress the first redraw and draw both operations at once after they have been completed? I have tried overriding OnPaint, OnBackgroundErase, etc. Double Buffering, AllPaintingInWmPaint, etc. has been set to true. No success so far. Now I'm trying to catch Windows Messages like...
4
12303
by: wasishincar | last post by:
I'm trying to read a bitmap and zoom in/out it on screen. I wrote some code but it did not perform as I expect. The bitmap shift 1 pixel to the upper-left coner when zooming in/out button was clicked. Please kindly help me to check if anything wrong with my code. Many many thanks. using System.Drawing; using System.Drawing.Drawing2D; // Click Browse to open bitmap file
4
10163
by: =?Utf-8?B?U3BlZWR5?= | last post by:
Hi there, I am currently writing an application where one inspects images and annotates certain features. Thus, one has to zoom in (4x) and pan around. The features are marked with little red rectangles.The images are 2048x2048 pixels. It seems that I can find no efficient way to implement both zooming and panning. At present I have a panel with autoscroll set to true inside which there is
0
1024
by: sorab | last post by:
I hav created a bimap image at run time using graphics object in vb.net. i display that image in the picture box i have also implemented few mouse events on that image. e.g. I can draw lines with the mouse. Now, i have a problem with drawing the line with mouse when i zoom that image..... i made picturebox size mode as zoom and incresed its size to zoom in how will i be able to draw line with mouse even after zooming
0
1620
by: johot | last post by:
I am currently creating a little photo application. In this application the user is able to zoom in the image and after zooming panning around inside the zoomed image with the mouse. The strange thing is that the first zoom is really slow, and so is the first panning. So if you zoom into an image it will first take some time, and when trying to pan the image around things will be really choppy. However if i zoom into the image even more, and...
0
9686
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10026
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7564
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4139
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.