Bitmap Drawing #2 - Make Something Identical To A Map-editor For A Game?
Feb 7, 2010
I don't want to spam the forum with questions, so I'll just ask a two questions I can't figure out in one thread since they all involve a specific task I'm trying to create I'm trying to make something identical to a map-editor for a game. Right now I'm just learning the basic functions of drawing on bitmaps. I'll show you what I got right now and then tell you what I'm trying to achieve:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim mySource As Rectangle
Dim myDestination As Rectangle
[code]....
So my map size is 1000x1000. When I press the button, it creates the map, draws 250 tiles(pixels) in the top left corner of the map, and then displays it on my form. Now to my questions: How can I zoom into certain X, Y positions on the map? After I zoom into the map, how can I call a function when I highlight a tile(pixel), and then another function when I click on a certain tile(pixel)?
View 15 Replies
ADVERTISEMENT
Dec 15, 2010
I'm trying to use a ToolTip directly to a Bitmap Object (System.Drawing.Bitmap), aparently I can't do this because Bitmap isnt a Windows Control.
View 1 Replies
Oct 9, 2009
I need to write a code to find identical adjacent pixels in a bitmap image. It should work as the 'magical wand' in Photoshop. My images are always black and white (white background with car parts drawed in black). Given the x,y coordinate for a single black pixel in the whole image, the code should find (and paint with another color, say red) all other black pixels that are linked to that one, and so on, until all linked black points will be painted in red.
[Code]...
View 2 Replies
Aug 12, 2011
I need to write a code to find identical adjacent pixels in a bitmap image. It should work as the 'magical wand' in Photoshop.My images are always black and white (white background with car parts drawed in black). Given the x,y coordinate for a single black pixel in the whole image, the code should find (and paint with another color, say red) all other black pixels that are linked to that one, and so on, until all linked black points will be painted in red.This way, suppose that I have an image with 4 car parts drawed, then if I give the x,y coordinate of a black pixel, just THAT part to whose the black pixel belongs to should be painted in red. All other parts will remain black. Does it make sense?At the end, there are two pictures (before and after) to help understanding what I need to do to the images.I tried a simple 8-pixel adjacent approach for every pixel (starting on initial coordinate) but it turns out into a very stupid and endless looping algorhitm.
Code:
Imports System.Drawing
Imports System.Drawing.Drawing2D
Imports System.Windows.Forms
[code]....
View 4 Replies
Aug 17, 2009
With this line...
If PictureBox1.Image = My.Resources._2star Then
I get this error: Operator '=' is not defined for types 'System.Drawing.Image' and 'System.Drawing.Bitmap'.Is there another way to say = with images?
View 8 Replies
May 20, 2009
I am having trouble overwriting an existing bitmap. I want to draw to a specified bitmap (union.bmp) even though this bitmap already exists. I keep getting a generic GDI+ error on the line "image.Save("C:/union.bmp")".
[Code]...
View 2 Replies
Apr 17, 2011
I need to convert a Drawing.Bitmap to 4 bit grayscale. Is there any way to accomplish this? I've tried using Bitmap.Clone but I only get the usual infamous "Out of memory" exception. Would this be grayscale even if it managed to convert to 4 bit?
View 3 Replies
May 17, 2012
I'm trying to save a panel control as a bitmap using the following code (VB.net):
Private Sub SaveFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles SaveFileDialog1.FileOk
filename = SaveFileDialog1.FileName
[code].....
View 2 Replies
Mar 29, 2010
is it possible to create a CachedBitmap from a System.Drawing.Bitmap within Visual Basic 2005 by using APIs ?
View 1 Replies
Jun 15, 2010
I', working on a program where there are several projects within a solution. The solution contains a forms application, a couple of class libraries, and a public interface.I'm running into a strange problem where I can access the system.drawing.bitmap namespace from the main form and from one of the class libraries, but when I try to access it from the other class library or the interface, it tells me it is not defined. I've tried importing it, and calling it directly with no luck.
View 4 Replies
Aug 25, 2010
Types have their own color (cyan by default).Enter completes the auto-complete suggestion.
View 1 Replies
Nov 18, 2010
I'm taking a screenshot as a System.Drawing.Bitmap and trying to send it through a network as a byte array.If I take the original screenshot and simply save it to disk, it's about 200Kb.Instead I'm saving it to a memorystream so I can write that back to a Byte Array and it's coming out over 6Mb.
[code]...
View 2 Replies
Aug 30, 2010
Recently I had the urge to make my own 2d game editor and I don't know where to start and I have searched the web but my results were not
View 5 Replies
Jul 19, 2010
I have a VB.NET Windows Forms app with a logo image on the form as a System.Drawing.Bitmap inside a PictureBox.I used the Visual Studio Designer to add the logo .bmp image so I don't currently have any VB code doing anything with it.I'd like to make the current logo a clickable object/button so when I click on it a file browser dialog opens and I can select a new image to replace the current image.The current image is a local resource and is set in a PictureBox as a System.Drawing.Bitmap.How would I replace that System.Drawing.Bitmap with a file selected from the file browser dialog?
View 1 Replies
Apr 21, 2009
Essentially I have a half text/half graphical tile game that has a level designer. I have several sets of tiles, all of which are bunched together in one file. I'd like to read a certain 32x32 square of said bitmap, and display only that portion on specified area of the screen. I know GDI+ enough to get the display going, so I just need help with reading the specified portion of the image from the bitmap.
View 4 Replies
Sep 11, 2009
Im making a simple image editor and I added Zooming and Drawing with mouse position like a pencil. My problem is When I zoom the image and try to draw on it, everything becomes offset and the lines i drew are not even close to the mouse. Here is My code ( Just add a button1 and Picturebox1 with an image)
Public Class Form1
Dim pen1 As Pen
Dim x1, y1, x2, y2 As Integer
Dim gr As Graphics
[code]....
View 4 Replies
Jan 24, 2012
How can I copy form and make identical form
say want to copy the style of one form & coding and make identicel form 2
View 4 Replies
Jan 16, 2010
Iv been making a Tron game for the past week and im stuck.What is the best way to draw the trail behind the "bike".
i have two arrays called StartPoint() and Endpoint(). Both of the arrays are constantly updated with every change of direction.
I need the trail to follow the bike and once the player changes direction, it needs to stop and start in the new direction.
View 2 Replies
Aug 12, 2011
I'm writing a game in VB 2005 Express and at the moment it involves using the drawimage method to first draw a background and then various sprites onto my form every time a timer ticks. It's all double buffered so there's no flicker or anything but it just goes very slowly, how to speed it up. I've come across the term blitting (bitblt), which seems like it would be useful, but haven't been able to work out exactly what it is, whether it can be used in this version of vb, how to use it etc.
Here's my code (or at least an approximation of the relevant bits seeing as the whole thing is rather long):
Public Class Form1
Dim BackgroundImg as Image 'plus all of my sprite images declared
Dim Mybuffer As BufferedGraphics
Dim MyContext As BufferedGraphicsContext
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
[Code] .....
View 6 Replies
Apr 2, 2008
im trying to make a game in visual basic in which your character can move around, jump, and kill things. I can get the picture box with the character to move and everything is fine. but i did run into one problem. when the character moves over a tree (or something) you can see the gray backround of the character as i made in paint. how do i make the backround of the picturebox transparent?
View 4 Replies
Feb 1, 2010
I am trying to make a game which basiclly lets you shoot ducks. i have a picture as a background (set as form image) i then have picturebox's with ducks flying flying around you shoot them the disapear etc.
My problem is the image. i have a picture of a duck and a blue square round it. and i would liketo make it transparant because birds dont fly with blue squares.
Below is an image to illistrate my problem
I have tried adding transparent background, transparant key etc
View 2 Replies
May 19, 2011
I'm doing a project for school. I'm trying to make a game similar to the Impossible game. I need a square (picturebox) to jump but I want gravity to effect it.
View 1 Replies
Jul 21, 2009
How can i make something like an editor, lets say word editor, how can i get it to highlite wrong words? and color words like "thank you" or something?
[code...]
View 5 Replies
Aug 23, 2011
i want to make an hex editor in vb or C++ in which i can edit the bytes
also i want to see that if a wrong byte is inserted or deleted a message or a warning should be displayed and file wont be reconstructed again..
View 17 Replies
Sep 25, 2011
I want to make an iso editor. ISO is a game or program file. In this case it is a game. I want to be able to view partitions and patch them so people can modify games. Im using VB express basic 2010.
View 4 Replies
Sep 23, 2011
I want to make a nes rom editor and i dont know where to start.
View 5 Replies
Nov 25, 2010
The error that I get is "Object reference not set to an instance of an object."[code]...
And is it even possible to do a vb6 style implementation? As I see it, this will clone the picture image while the vb6 implementation will just read directly off the image? and is lockbits like getdibits? I need to process 60 bitmap images of about 200pix by 200pix every second.
View 4 Replies
May 19, 2009
I just start with vb and wand to make a html editor, (i dont need help with html im webdesigner)i've made a form with a richtextbox how i can hilight tags like <HTML> or that everything becomes blue when you forgot >I can do that in javascript but not in vb?
View 24 Replies
Sep 26, 2011
I'm making a some coding editor and i have some question about how to make my editor how hint code like this picture
View 8 Replies
Sep 27, 2009
I tryed to make a new realmlist editor, but it says "This file is used by another process"..Code:
[Code]...
View 3 Replies