In my code I am taking a screenshot of a CAD screen. The image consists of various colored entities on an all-black background. I would like to find the extents of the non-black pixels in all four directions & crop the image to those extents or maybe a few pixels beyond.
how can i crop an image based on the size of my picturebox?
my picturebox's size mode is normal, i want to have for example, a 100 x 100 image using a 100 x 100 picture box, also i can drag the the image inside the picturebox so that i can have a focal point, a center of the image that i want to crop on.
I'm playing with creating thumbnail images for my photo website using VB rather than Photoshop.[code]However, I'd really like to be able to crop images to a square shape - same width and height - from a starting image that might be 1000 pixels wide x 667 high, 500 wide x 750 high or already square and around 750 x 750. In other words, crop a square from the central area of a jpeg image, irrespective of it's exact size.
I'm playing with creating thumbnail images for my photo website using VB rather than Photoshop. I've found some great code for resizng jpegs whor this one:
Imports System.Drawing.Drawing2D Public Class ImageResizer Public Shared Sub ResizeImage(ByV
If i wanted to crop an image in VB.net, how would I go about doing it? I am trying to let the user drag out the box they want (system.drawing.rectangle), and it will automatically remove the edges surrounding the box.
My first problem is primarily the fact that I cannot make the system.drawing.rectangle visible. It is not displaying at all, I am setting its location and height programmatically, but nothing is showing up. I know there is probably something fairly obvious I am missing...but I cannot seem to find it.
My larger issue, however, lies with the cropping itself. I cannot find any crop methods, at all. Is there a hidden one I am missing? Or must I code it myself? How would I go about doing this? It ought to be able to output to a bitmap image object.
how would I allow my screen capture to crop and capture only a particular area of a screen?The user should be able to select the area they want to crop. It would be good if the cursor changers to a plus like other screen captures and also the screen is all paused so the user can select the area they want.v
I'm in essense trying to make my own interpretation of the NES hardware, so I can make a game that ideally would resemble what a NES game would look like. I'm currently stuck with how to adjust how to draw the playfield to the video memory (back buffer).
Backbuffer: The NES had restrictions on the nametable, or backbuffer. For my example, the backbuffer is 256x240pixels big, or the size of one screen. If I drew this to the TV, it would fill up the screen perfectly. Now, if I drew this to the screen with an offset of X=5, the entire image would be shifted and would wrap around the screen.
For example..... ORIGINAL, NO OFFSET: DRAWN WITH OFFSET OF X=5: ABCDEFGHIJK GHIJKABCDEF DRAWN WITH OFFSET OF X=-5: FGHIJKABCDE
The screen is split up into squares 8x8 pixels each, totalling 32x30 rows and columns. (256x240 pixels). The offset is represented in pixels - not columns; so in theory, I could offset the screen by 5 pixels and every column would be shifted to the right by five pixels.
Level Design: My stages are made up of screens, containing data that is represented in 16x15 rows and columns, each by 16x16 pixels. This is to emulate how many NES games stored level data - each tile holds info about what should be in each 8x8 block. E.g.: AA BC with A,B,C,D representing what 8x8 graphic should go where Level design is represented by this as well, with each number being a different screen and - meaning nothing, null. ----- -123- ---4- --54- ----- Character Replacement: This is easy. I already know how I can determine which table, row, and column my characters are on based on their absolute positioning. I can also determine the relative positioning within the screen.
With this info, I can easily figure out which columns are to the left and right of the character, if any (if the character is at the left side of screen 1, thered be no more level left). How do I draw my levels to the screen, so that they scroll from one to the next. It would be relatively easy to draw one full screen at a time, and when the character gets to the edge just flip to another screen. However, the problem I'm conceptually having is that I need to 'stream' the level data onto the screen. That, lets say the character moves 24 pixels to the right. The BG needs to move as well. So, I need to adjust the scrolling of the backbuffer by 24 pixels.
However, just scrolling alone will cause the screen to wrap over, diplsaying old portion of the level. So, while scrolling I need to make sure to draw new pieces of the level to the back buffer. But before I can do that, which tiles need to get drawn first. And if the person goes 24 pixels to the left, I need to redraw tiles onto the backbuffer and change the offset accordingly as well. And let's not forget that if the character moves right and there's no more level data to be drawn, there should be no offset but instead the character gets closer to the side of the screen (instead of being centered in the middle of the screen via the X axis).
How can I build a cropping tool such as the one in Office Picture Manager as seen below? Notice that as soon as the Aspect ratio is selected a cropped area shows on the picture that can be dragged to the perfect position creeping the aspect ratio in tact. This is why I wanted somehow to link my app. to Picture Manager. I want the picture to open in Picture Manager, cropping tool already selected, ready to be dragged to the perfect position. Unless you have some code that can do jut this.
I have several images that are going to randomly display in a picture box on a vb.net form. My question is, is there a way to auto-size the picture so it "fits" into the picturebox?
Suppose if the user selects an image which is bigger than the size of the button, then i want it to autosize the image so that it fits the button I am providing an OpenFileDialog to the user to select the image for the button
I don't have code because I don't know if its possible. I need to make a webbrowser for work that will auto rezie images like internet explore does when it is to big for the browswer, I have done it with vb6 b4 by parsing it into ram and then displaying the image, but I don't know how to do it in vb.net cause the code will not convert. Also I need to have vb.net auto send user name and password to the website its navigating to. The website uses a standard username and prompt window that pops up once you navigate to the web address.
I'm considering a personal learning project. Using .NET(preferably VB) I want to build a simple desktop app that's only function is to display comics, like CDisplay, but with more advanced navigation. I want to be able zoom in by clicking on certain areas of an image, individual panels for instance, and have the zoom area automatically snap to the panel and blow it up. The images are usually in a standard format like .jpeg, .png, etc..
Something like this is what I'm going for: [URL]
I'm not even sure what this is called? Image mapping? Tone mapping maybe? Is it possible to do this within .NET or would it require some kind of outside library? Code samples would be nice, but obviously this is pretty vague request.
I made a picture box and imported an image named Title.jpg. Later I made adjustments to the picture and imported it again without deleting the original(mistake). The new one had the name automatically changed to Title1.jpg. So I deleted the original image from resources and renamed Title1.jpg back to Title.jpg.
Now I got two problems. First, only Title.jpg is on the solution explorer, but Title1.jpg(along with Title.jpg) still pops up on the resource list when I click on Image property of the picture box. There's only the name and no picture, and I don't see a delete option. How do I get rid of it? Second, even though I changed the image to the new Title.jpg in the picture box, the old one is displayed when running the app. What's up with that?
Ok, I am trying to figure out how to crop a number, from a label, even though that label has text in it.For example: Label3 reads testing 123I would only want the 123 bit straight from the label so I can use it there and then without
I am trying to make an Image wrapper class or something. The reason for this is that I need to output a bunch of images only, without pictureboxes. I don't want an imagelist, because I need the images along with their associated image properties which an imagelist cannot provide. I ended up with this :
I have a specific image that I want my application to look for on a specific window. I've done something similar to this along time ago with VB6, but it was slow, and it was checking for specific points in the picture rather than the whole image itself (for speed reasons). I named this image "Image1.jpg" and I want to compare it to the window with the handle "001C08F2" and class "SunAwtCanvas"
Hey i want to know how u auto press a key example; i got 1 button that's called : Start (button1) and if u click start that it keeps clicking space on your keyboard.
What I actually want to do is directly enter the Value into the Active Browser page, rather than the program contained 'Webbrowser1'. What code do I need to access the Current Browser Web page (be it IE, FireFox etc)?
I've an old vb6 ocx in order to show an msgbox with autoreply in n seconds.
rm = waitMsg("can't connect to host...",9,"*Retry","Cancel") if rm = 2 then exit sub 'cancel
acts in same way of msgbox, but after 9 seconds (in the example) then auto click the Retry button (the default button, the one with * prefix). maybe I could convert this old ocx to net, but wondering if there is not an better alternative using messagebox.
Is there a way to print PDF files within the .NET framework? I'd like to set up a directory to monitor and when files are copied there, the program prints the PDF file and deletes it. I just don't know how to handle the printing without using Adobe.
I've made it sofar that I can scroll through the list using timer.But I want when the end of the list is reached the selectedindex should return to the first item (or different if set).Now it stops at the end and gives an error:
InvalidArgument=Value of '4' is not valid for 'SelectedIndex'. Parameter name: SelectedIndex This is the code I use (timer1_tick):
I'm just now starting to work on something that works 'like' an ide, where it will auto space my text as I type. I really JUST started and I'm not sure if I'm even doing it remotely like I should. anyways, what I'm doing is on TextChanged (eventually I'll just do it on newline but that can wait) it gets the contents of the text box, puts each line into a string array, trims the excess whitespace, see's if it has a keyword in it, and then adds some whitespace to it if it does.I know I'm doing something wrong with either my declarations or my error handling. Mostly because i'm not sure how to work with string arrays, can you help me with my syntax?[code]
is there an option to retain Intellisense suggestions but turn off the auto-complete completely in VB 2010? Since upgrading to Visual Studio 2010, I find that Intellisense's auto-complete is far too eager to replace code. It often happens that while typing a section of code I will find that I need a new variable. Rather than back up in the code and create the variable, I want to be able to type on and add the Dim statement once my train of thought has reached a good stopping point. However, as soon as I try to use an undefined variable or method or property, Intellisense jumps in to replace what I have typed with gibberish.
I like Intellisense showing what methods, properties and parameters are available; however I would like to turn off the feature which automatically triggers auto-complete whenever I type ahead.
I am creating auto mailer but i am having problem on BCC. BCC is listed on checkedlistbox. Image ([URL]) I would like to send on those email address every 5 seconds. but my problem is i'm always getting an error message "a recipient must be specified" Here's my code...
I have previously asked a questions regarding DataGridView control:[URL].. now I'm trying to make the first column to include an autosuggestion. ie. when a user types an ID(say, "12") then all the records that starts with it(ie. "12*") will be displayed as suggestion.
And upon clicking an ID, the corresponding product_name will be displayed on the next column. I think, I could do this using Validating() event of DataGridView.
how to automatically find the correct com port of my GSM modem.i can retrieve the available ports of the computer by using My.computer.Ports.Serial PortNames.can i find the right port using the display name property of the device?