bitmaps in forms

lulu_703

New member
Joined
Jul 7, 2003
Messages
3
I need help related to bitmaps...
I have decalred a bitmap in which i drew some shapes, I want to save it as a Gif image
The thing is I want to have other things in the file such as labels or other bitmaps, but
I cant figure out how to do that... Can anyone give me an example on how to do that?

This is the code I use for the bitmap:

dim objBitmap as new Bitmap(400,300)
dim objGraphics as graphics

objGraphics = graphics.fromImage(objbitmap)
objGraphics.Clear(blue)
objGraphics.Save(response.OutputStream,imageFormat.gif)
 
If by labels you mean you want to draw text and not draw a Label control, you can use the methods of the Graphics object you created. Look at its methods such as DrawText and DrawImage.

-Nerseus
 
Im afraid i havent made myself clear, I already use the methods to write strings in the bitmap... but i want is to add other form elements other than the bitmap e.g button,textbox,...

I cant seem to be able to do that, the bitmap simply overwites that.... someone said use a picturebox , but Im not sure I know how to do that....Can you show me?

thanx in advance
 
If you want things like that in there youll have to draw them yourself.
 
You want to save the appearance of the label control on your form within the gif image?

You can problably find some way to "Capture" a image of the screen and then pull the image of the label and then draw it onto your form.
 
what i want is to use a container for the image so that i can add other form elements ... i cant do that since I write the image tio the output stream.... Is a picture Box a solution?
if it is can you tell me how to declare and use one?
 
You cant save the position of the controls within the container to a image file. You can save the image file and then add the positions of the controls within the picture box to the end of the image file, but you will not be able to open the image file in other image viewers. Go on PSCODE.COM and search for "binary file" or "setup" to learn how to add files to the end of other files.
 
Back
Top