Bitmaps: Zooming To Pixel Level?
Jan 9, 2012
I'm experimenting with the various graphics, bitmap and image functions of vb.net 2010, with the aim of being able to create an image processing tutorial program for my Physics AS group. Currently, I'm trying to zoom in to an image so that individual pixels are clearly visible. The below code shows what I'm doing.
My problem is that the zoomed in image always comes out blurred; the individual square pixels are not visible. I presume this is because as the DrawImage method resizes the image, it re-samples the image in some way. Is there a way of resizing the image while retaining the pixels as in the original image, so that individual pixels are visible? I've tried several other methods, including drawing to a picturebox control and then resizing the picturebox with the size mode set to zoom or stretch... this results in the same blurred image.
[Code]...
View 7 Replies
ADVERTISEMENT
Feb 27, 2009
Ive been working on creating a side scroller game, and the back color of my pictureboxes needs to go. when transparent, it shows through the program and onto whatever is active in your Windows os(usually Visual studios).
I am trying to rip pixel color off of the background image picturebox( the level), and replace parts of the character picture box that show transparency with the level art. there may be poor logic in my code?
Heres my code:
Dim newImage As Bitmap = New Bitmap(PictureBox1.Image)
Dim backImage As Bitmap = New Bitmap(PictureBox2.Image)
Dim ximg As Bitmap = New Bitmap(PictureBox3.Image)
[code]....
not the best idea, but all i get is one color for all the level pixels placed in the new image, which is odd. any poor logic you see in this code that could allow the newImage.setPixel not to be 1 color? when i breakpoint, it is recieving different colors from the backimage.getpixel, but only putting one shade on for setpixel somehow. im not going for an accurate color read from the background yet, just wondering why im getting 1 pixel color for the whole picturebox background when being changed.
View 1 Replies
Jan 30, 2009
I would like to load a GIF file, and start with the first pixel and check to see if that pixel color is closer to Black, Red, Green or Yellow, then take what ever color it closest matched to and output that color as a number, 0, 1, 2 or 3. So just for a small example a 5x4 GIF would be converted to something like this: 0112223322220111332?
View 13 Replies
Jul 4, 2010
How do i determine the pixel width and pixel height of the largest image i can paint onto the graphics object of a printer while inside a printpage event?
Imports
System.Drawing
Class
[Code]......
View 2 Replies
Sep 13, 2007
Is there a quick way to check the color of a pixel on the screen?
View 2 Replies
Jul 20, 2009
during the development of my project, i've fall in the need to change the position of some forms, pixel by pixel using a timer.Now, i've checked that the movement is very fluid when form is not very heavy, when it contains few elements, but when it has a lot of elements inside, the movement becames nervous and not fluid, the movement becomes jerky.
View 5 Replies
Jul 29, 2010
How can I find out the pixel colour of a certain point on a web browser. For instance,WebBrowser1.getPixelColor(0,0) would get the rgb colour value of pixel 0, 0.It doesn't have to be rgb it might be hsl or whatever.The web browser is showing a local web page that is hosted on a network. If there is an error then the screen goes all grey. What I want to do is, if this does happen, display an alert message like - "An error has occurred
View 3 Replies
Apr 16, 2011
I have an empty picture box with the background colour set to the transparancy colour. How can i get the colour of the pixels within the transparant picture box so that i can create a bitmap of the transparant section of the form?
View 2 Replies
Apr 1, 2012
I am creating an Excel add-in written in VB.NET. I would like to bind KeyDown and KeyUp events to the spreadsheet to record when the user presses and releases the arrow keys while navigating the spreadsheetIdeally, these events would be built into Excel alongside the native SheetActivate and SheetSelectionChange events, for example. Alas, they are not.
View 1 Replies
Jan 6, 2010
In Visual Basic 2008, there's two different ways that I know of to accomplish the same thing:The Dim on the member level:
Dim counter1 as integer = 0
Dim counter2 as integer = 180
Public Sub SampleSub1()
[code].....
View 1 Replies
Mar 18, 2011
I have created a simple program which uses a two tier structure of SQL Tables.At the top level, one record holds the date of the activities and linked to it using its primary key as a foreign key, three subordinate tables hold time stamped records.The issue I have been unable to solve is that before adding any of the lower level records for a given date, a newly added top level record must be saved to the database.Doing this manually is simple - but can I rely on my users to remember to do this before they start plugging in the lower level data?I thought not, so I am looking to save the top level automatically.I've failed miserably but I refuse to believe that it's not possible.
View 14 Replies
Jun 29, 2011
I have a picturebox with zooming/pan capabilities. I am now starting with the zoom. I did that by:
getting the mousescroll event( up or down)
add height and width to the picturebox
get the pixel coordinates of mouse inside the image.
my problem is that, when i change the size of the picturebox, the pixel coordinates in the picture is not the same with the previous image without zoom. I need the coordinates to be the same even the picture is zoomed.
View 1 Replies
Sep 12, 2009
i need to add zooming option for picture box with C#
View 1 Replies
Mar 4, 2011
i was trying a painting applicaion in which i am trying Zooming and editing.it means after zooming i will edit or draw the some thing in the canvas.i i am able to do that but th problem is scalling. here i ma using the translate transform to zooming.
after zooming if i draw somthing my mouse positions are not correct.
[Code]...
View 6 Replies
Apr 3, 2012
I have a picture box control on a form that displays an image that I draw. I create a bitmap (oBM) using the picture box's ClientSize width and height. Then I create a graphics object to draw on... OutputDevice = Graphics.FromImage(oBM)
[Code]...
View 3 Replies
Mar 23, 2011
i have a question to do with vb.net. i have a picturebox with zooming capabilities. but i want the zoom button to zoom a certain percentage with each click. for example:
1st click zoom image(1.5)
2nd click zoom image(2)
3rd click zoom image (2.5)
[code]....
View 2 Replies
Nov 6, 2010
I have a trackbar in my application where somebody can zoom in and out from a picture.
I can now zoom in with this code under the Value changed event of the Trackbar:
Private Sub TrackBar1_ValueChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TrackBar1.ValueChanged
''Dim scalefactor As SizeF
[Code]....
View 1 Replies
Sep 20, 2011
I've been trying to get zoom capabilities on this
Public Class Form1
Private m_PanStartPoint As Point
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
[code]....
I can drag the whole panel around and scroll thru the picture but some of my images are quite large in length, is there any way for me to add zoom in or out capabilities to this code? tried adding a couple of button on my panel for "Zoom in" and "Zoom Out" but no functionality, sorry for the syntax i deleted the code before this post trying to do it from memory, after i double clicked the button it gave me the
private sub handles button click
private sub handles button click
then
[code]....
View 5 Replies
Jul 9, 2010
.NET Bitmap class uses GDI+
I want to know how many Bitmaps I can create.
Will memory leak when create too many Bitmaps?
View 6 Replies
Jan 13, 2012
I'm trying to make a picture viewer, with which users can see the actual size and fit screen size of the picture. They can also zoom in and zoom out and control the view with scroll box. If its not possible by picture box then what other control should I use?
View 2 Replies
Aug 31, 2011
I need serious advice here please. I use Visual Basic Graphics Programming by Rod Stephens as a reference, and I have visited his site vb-helper.com to try some of his tutorials. I tried the scribble application and it's working out fine (you can download the snippet from his site).
What I have trouble with is zooming in. I am not sure where to start. I would like to zoom in to x2, x3 and etc. of the bitmap I am working on and I would like to be able to continue to edit the bitmap. This would mean that I have a larger pixel brush under the mouse cursor, to lay down pixels. So a x2 zoom would mean a 2 x 2 pixel.
Has someone done this. Do you have a reference I can use for this. This kind of editing is standard in almost every paint package. Even Microsoft Paint, but there is not too much basic information on how it fits together in code for vb .net. So I am looking for someone to point me in the right direction. As I said, I am using the scribble application as a base, so here is the link. [URL]..
View 4 Replies
Jun 13, 2011
how can i zoom an image inside a picturebox? and i also want to know how can i make a picture inside the picturebox draggable while at the same time, it can be zoomed in and out.
my goal is to crop an image inside the picturebox and i can zoom and drag the image inside if necessary
View 2 Replies
Apr 24, 2010
I'm currently working on a project where I need to bind 3 different bitmaps.Bitmap1, Bitmap2, Bitmap3.
I tried :
bitmaps = Bitmap1 & Bitmap2 & Bitmap3
But of course, that didn't work.If it's possible, I also need Bitmap1 and Bitmap3 to have a fixed size and Bitmap2 to change its width if the form is resized.
View 3 Replies
May 22, 2009
I'm trying to create a new bitmap from a filestream...I keep getting the error "parameter not valid" on the line[code]...
View 6 Replies
Feb 12, 2011
I have multiple level of For Each and in each level, i have a Linq that is the 'In' criteria as in:
[Code]....
It will go inside each for (because the value is not nothing), however, it will only loop (next) in the very inner 'For Each t In tFor'. After it is finish inner loops, the outer Fors' or Next will not execute... even thought there are more than one values in that 'In'... like 'sFor' or 'fFor'. i've noticed while debuging, while break at the for (for example 'sFor', before stepping in), i get the error message:
"Enumeration yielded no results" when i expand the result for that variable and it will not step into it. but if i do not expand the result, it will step in. It seem that some how, once an element is accessed for that 'In' collection, it breaks (meaning does not loop for the rest of the elements) the next for that collection is this a bug or am i missing something in Linq? BTW: i believe it has something to do with the SqlDataReader in the Linq. I'm working with IAsyncResult.
View 5 Replies
Jan 5, 2011
I managed to combine two .png images into one, and then display the result in a pictureBox image.However, the pictureBox seems to scale up my image! Makes it bigger!The pictureBox size is 96x128. The two images I have combined are 96x128. The pictureBox's SizeMode is set to "Normal"I have noticed that even though the pictureBox's image seems to be zoomed, it is cut to keep the 96x128 rect. But I don't want it to be zoomed...
View 6 Replies
Feb 6, 2010
I've found an example of what I'm trying to do. The form will have 2 picture boxes. The first will be the original image. The second will have the zoomed image. Once I move my mouse over the first image, it must display a zoomed image in picturebox 2. I've attached the code that I found (written in C#) of what I'm trying to do. I've converted the code for me to VB. I want my first picturebox to be smaller than my second one. And the attached example shows that the first picturebox is bigger than the second one. I've never tried something like this, or drawing images etc. Just resize the 1st picturebox to be smaller that the second one, move with your mouse over the first one, and will see what I mean. I don't want to click on the image to have it zoomed or use the mouse wheel. Just want to hover over the image and display the zoomed version..
View 2 Replies
Dec 16, 2011
In my vb.net project, I use zedgraph to draw figures. I find that the following properties work well to zoom figure on the center of mouse.
[Code]...
View 2 Replies
Jul 21, 2010
I have a function that returns a bitmap meant to be used as background in a panel, and occasionally I'd have to call it to create a new background based on parameters
View 2 Replies
Jun 19, 2010
i want a way in which i can extract 2 bitmaps from winload.exe.mui file in vb.net 2008
View 6 Replies