See If Image Drawn To Form Through Graphic.drawimage Has Been Clicked?
Nov 11, 2011' Show game directions.[code]...
I think this is actually really easy to do that it isn't documented on here or msdn.
' Show game directions.[code]...
I think this is actually really easy to do that it isn't documented on here or msdn.
I need to draw several line-graphics on a form, then select and drag individual graphics to new locations. Is it possible for example to give each graphic path an identity when drawn, then select any one (via mousedown, whatever) and link it to the dragged mouse co-ordinates until released? MS Visio has exactly this ability - can it be done in .NET?
View 4 RepliesI am working with a very simple (so far..) little program where i use som trig to create a circle using pixels created vith the Ellipse-comand "(x, x, 1, 1)" etc.
But I want to se when the graphics is drawn, just not the finished circle, how do I do that?
I use the "Paint" version of the form. I am a beginner so excuse my poor skills. Shouldn´t this be a very simple little problem?
I work with Visual Basic 2008 Express
How do I flip the image upside down (below the first image) Like as if a house were at the waters edge and you can see the house, and the reflection in the water?
code for drawing the image (which is a battery)
VB
'Finding center'
Dim batX As Integer = 160 - (imgDct(cbo_Battery.Text).Width / 2)
Dim batY As Integer = 200 - (imgDct(cbo_Battery.Text).Height / 2)
'Draw Battery
[Code]...
This is in a class, the class inherits Panel. VB.net
[Code]...
The goal is to have this image stretched to 300x50 Whenever I do it, it works, but it fades the image from left to right, so that at Left = 0, the image is solid, but at Left = 300, the image is transparent.
I have tried to realign the image by down and right one pixel, but still only part of the first row and column are visible when zoomed.I can't find exactly what I'm looking for online.
My computer is an HP-Pavillion dv9600 Notebook PC.
OS: Windows Vista SP2 32-bit
The following code reproduces the problem:
Public Class PictureBug
Dim pxlColor As Color
Dim img As Bitmap = New System.Drawing.Bitmap(My.Resources.TestBug[code]......
I am programming a design surface where I add Image objects to the surface when an image is added it calls the draw objects command. It works fine I would like to figure out how to covert the object to an image to save it? Below is the draw sub used to draw objects onto the surface:
Public Sub DrawObjects(ByVal g As Graphics, ByVal Scale As Single)
Dim drawObj As GraphicObject
Dim i As Integer
[code]....
I have a graphic image in a project's resx file that I would like to use in another project. Unfortunately, I can not locate the original file, an animated gif. Is there any way to export or otherwise extract the graphic image from one .resx file for use in another?
View 11 Repliesrectangle drawn on picturebox gets erased when i scroll image.i.e
i have made application for image cropping. on mouse down and mouse up event, an rectangle is drawn on picturebox using graphics.
1) now the problem is that when scroll image rectangle drawn on picturebox gets erased.
2)now i want resize this rectangle as per user's interest
how to resize the rectangle and drag the rectangle on picture box.
I'm trying to use an image as the fill in a series in a bubble graphic. I know we can set what's in the clipboard as the filling of a bubble, but when I try to record the macro nothing happens...
Can anyone tell me what's the code to put an image from the clipboard as the fill from the selected bubble series?
I'm trying to make a mini map for a 2d space shooter of mine; I've for the math down (I think) for when an item should appear on the mini map, but the problem is the graphic. As it stands, the graphic spills over the edge of the mini map graphic and disappears only when it's fully outside. I need it to crop the image, or at least not show it off the mini map graphic.I thought of using the sourcerect rectangle of the spritebatch.draw, but it seems to me that would only work for the right and bottom section, as I can adjust the size of the rectangle. I haven't tried this yet, but I will soon. Can the location of the source rectangle be changed in relation to the graphic that it is a part of being drawn so that I can use that to crop the left and top sides?
View 5 RepliesI am drawing lines on a picturebox - not in the paint event. I realise that if I resize the PictureBox the lines won't be redrawn - but the PictureBox is fixed. If I display a MessageBox at the end of my draws the lines do not remain on the screen. This was OK with VB 6.0. Hoe can I stop them being erased?
View 2 RepliesI'm creating a custom form that is composed of a inner stroke, outer stroke, and rounded rectangular background. When the form is initially drawn its drawn fine without errors but once i re size it, the old form is still drawn and the new form is drawn below it but once i minimize the form and restore it, it goes back to normal (only the new form is being drawn).
View 2 RepliesI have a dialog box with PictureBoxes in it, as you can see on the attached image.What I want is for when an image is clicked, its path is copied into the variable SBGImagePath and it is given a 3d border to make it stand out a bit.
View 12 RepliesI have a VB .Net windows form application.On a button click I call a Function, say FunctionA ..and want to freeze all the controls on my main form and display a wait graphic, until FunctionA has finished executing.
View 3 RepliesI have drawn lines and boxes on a form programmatically. How do I programmatically delete one of them? Let's say I draw a line and then a box, (using button1). How do I delete the line and not the box? Or can I?
View 6 RepliesRight so I have made a graphic of a coin being flipped. Heads is shown on one graphic, tails on the other. I wanna set it up so that when I hit go it will randomly play one of the two graphics on one of my forms.How easy is it to add a .gif file to a form that can play when told to? What is the code im looking for to help with me with what I'm trying to do?
Another thing I plan to achieve is also a random number generator that will display a number on a ball that rolls on to the screen. So the displaying of a number will be timed to show up when the ball comes in focus. I have some code that I have used previously to generate a number, but I wanna get the generated number to show in time with the ball rolling up.What are some wait commands to use in vb .net? This is the code I am using to randomly generate a number.
vb
Dim r As New Random
TextBox1.Text = r.Next(0, 150)
I designed a complicated graphic that draws on a Visual Basic screen. But how can I transfer the image to a bitmap or some other format that I can post on the Internet? I've tried the XAML editor in Microsoft Expression Web but people don't like downloading Silverlight, at least that's what they tell me.
View 2 RepliesI am working on a snake game for my portfolio and was wondering where the best place to put the logic for drawing the snake. Should the code reside within the snake object or within the form? Either would work, but I am wondering from a business objects/coding standard perspective where such code belongs.
View 2 RepliesI am using the MouseClick event toc change the image of a picturebox when it is clicked:
Private Sub PictureBox7_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles PictureBox7.MouseClick
PictureBox7.Image = Image.FromFile("C:Documents and SettingsjacobscDesktoplogogoclick.png")
End Sub
The problem i have is that this tool will be used on different users computers and not just my own and at the moment when it is used on another computer it gives an error that it can'f find the image.
This obvioulsy happens as it is looking for my desktop, how can i change so that the image can be saved within the tool and therefore will work on other computers?
I need to display two images when the button is clicked. First the user will browse for the two images and after clicking the third button it should display the two images. I have this code so far. I'm a complete newbie in vb
Dim dialog As New OpenFileDialog()
If DialogResult.OK = dialog.ShowDialog Then
TextBox2.Text = dialog.FileName
End If
I've created a label that changes text when I click a button. I also want an image to appear under the label after the button is clicked. I added the image with an image control(not sure if this is correct) and I want it invisible until the button is clicked. What Code Behind should I use for th ebutton.
View 3 Repliesget a button on form A to open form B and then close (not hide) form A when clicked?Background: I am coding a VSTO application for Excel in VB2008.
Private Sub FormAButton_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles FormAButton.Click
Dim FormB As New FormB
[code]....
I have a form that contain 30 image (load by array) and when one of the image clicked, the background of my frmMain should change to the image clicked. The program has no problem by launching the code below :
Private Sub PictureBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picWallpaper1.Click
frmMain.BackgroundImage = picWallpaper1.Image
End Sub
Private Sub PictureBox2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles picWallpaper2.Click
[Code] .....
But this way is not effective if I want to increase more image up to 50,60 in future the program will loaded with these code.
Just wondering the best way to find out when an image is clicked on in treeview control
View 3 RepliesJust wondering if its possible for an image to be displayed along with some text when an item is clicked in a list box?
View 4 RepliesI have a routine where I click on an image in picturebox1. When the user clicks I need picturebox 2 to show a section of the image in picturebox1 centered on the users click but zoomed in. I have the following function which is doing exactly what I want it to do (except properly zoom in.) I have been able to achieve something that appears to be a zoom but it no longer centers on the clicked point.
Public Function magnify(ByVal position As Point, ByVal main_pic As PictureBox)
vert2.Clear()
horz2.Clear()
Dim img As New Bitmap(pic_magnify.Width, pic_magnify.Height)
Dim gr As Graphics = Graphics.FromImage(img)
[Code] .....
im having a similar problem like the solution here Prevent main form from appearing when showing another form . but some of the suggestions were to minimize the main app so it doesnt show, which i cant do because my main app is supposed to be a desktop to be underneath all other apps to replace the windows desktop. And the second forms are supposed to be sticky notes. so i cant minimize the main window cause it has the user background and other controls. i tried making the parent of the notes a Nothing pointer, a pointer to the desktop, creating the form through a dll but i had no success.My main problem is that when i click a note (form2) form1 comes up, even with form1 having the WS_EX_NOACTIVATE in the createparams. form1 does the form2.show() but they shouldn't be attached.Another reason im having trouble with the solutions preseted in that post is that they are for delphi and im doing it in vb.net.
All i need is being able to click on the controls and write in the note without bringing the main form behind the note. either making them independent, or making the note not focusing the first form or being able to operate the note without it activating. i dont know. my last resource is to attach my main form to the desktop but i've heard is the worst thing you can do because it can cause problems hanging the system.
I am using this code to draw a line on a form using textboxes as the x and y coordinates. I then click the button with the code below that will draw the line.
Before the new line is drawn, I would like to have previous lines deleted first.
How can I delete these lines?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim canvas As New ShapeContainer
[Code].....
I have these three images that I have drawn to my form.
GraphicsBuffer.DrawImage(ButtonEasy, New Rectangle(25, 330, 100, 50), 0, 0, 100, 50, GraphicsUnit.Pixel, ImageAttributes)
GraphicsBuffer.DrawImage(ButtonMedium, New Rectangle(150, 330, 100, 50), 0, 0, 100, 50, GraphicsUnit.Pixel, ImageAttributes)
GraphicsBuffer.DrawImage(ButtonHard, New Rectangle(275, 330, 100, 50), 0, 0, 100, 50, GraphicsUnit.Pixel, ImageAttributes)
But I want to make a Boolean expression for when they are clicked so I can trigger the events to load the game mode selected.
Do I do this through resource code or is there a simply way to do this. My idea seems like it would be bad and not syntaxically correct.
Edit: I've gotten to this:
Private Sub ButtonEasy_MouseClick(ByVal sender As Object, ByVal e As MouseEventArgs) _
Handles ButtonEasy.MouseClick
[Code].....