Click to See Complete Forum and Search --> : GIF GRAPHICS! GIF GRAPHICS! GIF GRAPHICS! GIF GRAPHICS! GIF GRAPHICS! GIF GRAPHICS!
Xenonic_Rob
Sep 24th, 2000, 03:52 AM
Hey peeps, your fellow webmaster and programmer Xenonic Rob here.
Just a thought -
1) Is there any way of saving the contents of a picture box to a BMP file?
2) How can I drag objects around a form at runtime?
Thanks!
[Edited by Xenonic_Rob on 09-27-2000 at 01:18 PM]
Mad Compie
Sep 24th, 2000, 04:07 AM
Yep, the VB statement SavePicture does the thing:
It saves a graphic from the Picture or Image property of an object or control (if one is associated with it) to a file.
Syntax:
SavePicture picture, stringexpression
The SavePicture statement syntax has these parts:
Part Description
picture Picture or Image control from which the graphics file is to be created.
stringexpression Filename of the graphics file to save.
Remarks
If a graphic was loaded from a file to the Picture property of an object, either at design time or at run time, and it’s a bitmap, icon, metafile, or enhanced metafile, it's saved using the same format as the original file. If it is a GIF or JPEG file, it is saved as a bitmap file.
Graphics in an Image property are always saved as bitmap (.bmp) files regardless of their original format.
Secondly, here's an example how to use the Drag method:
Begins, ends, or cancels a drag operation of any control except the Line, Menu, Shape, Timer, or CommonDialog controls. Doesn't support named arguments.
Syntax
object.Drag action
The Drag method syntax has these parts:
Part Description
object Required. An object expression that evaluates to an object in the Applies To list. If object is omitted, the object whose event procedure contains the Drag method is assumed.
action Optional. A constant or value that specifies the action to perform, as described in Settings. If action is omitted, the default is to begin dragging the object.
Settings
The settings for action are:
Constant Value Description
vbCancel 0 Cancels drag operation
vbBeginDrag 1 Begins dragging object
vbEndDrag 2 Ends dragging and drop object
Remarks
These constants are listed in the Visual Basic (VB) object library in the Object Browser.
Using the Drag method to control a drag-and-drop operation is required only when the DragMode property of the object is set to Manual (0). However, you can use Drag on an object whose DragMode property is set to Automatic (1 or vbAutomatic).
If you want the mouse pointer to change shape while the object is being dragged, use either the DragIcon or MousePointer property. The MousePointer property is only used if no DragIcon is specified.
In earlier versions of Visual Basic, Drag was an asynchronous method where subsequent statements were invoked even though the Drag action wasn't finished.
Xenonic_Rob
Sep 24th, 2000, 04:14 AM
Thanks.
You're probably wondering why I've asked this -
I'm making a program where I can drag particular objects around the screen, and save the picture box every millisecond to a bmp file somewhere.
Then, i'll convert it into an animated GIF.
It's kinda quicker than moving it frame by frame...!
Mad Compie
Sep 26th, 2000, 12:45 PM
Every millisecond? Isn't that a little bit too fast?
/\/\isanThr0p
Sep 28th, 2000, 06:10 PM
In fact you won't be able to save 1000 BMPs which makes a size of
1024*768*32 (on most computers) * 1000 BITS!
thats makes about
2.4 GB
Fox
Sep 29th, 2000, 12:14 AM
Slow doen the framerate to 30 or 40 fps and save JPGs instead of bitmaps... there's an example how to do this on my page.
ok robby,
i know its a bit late since you put this up, and it really has nothing to do with you subject, but i was just skimming through these posts, and i am sick of seeing your stupid subject lines! just stop it! it pisses me off! and i don't know if im just crazy but im sure it pisses off other people too! so just stop it!
thanks pal...
Xenonic_Rob
Oct 1st, 2000, 05:05 AM
t_dawolf:
Thanks, but hey - since you were just skimming, it got you to read it didn't it?
Sure, it can be annoying, but people who are just skimming do read the posts with capitalization and that have nice long subjects.
Anyhow, it's not on all my posts :)
ok,
ill give it to you, it got me too read it, not because i thought it was interesting or anything, but i had the specific intent of telling you to stop writing those stupid headlines, usually i just ignore your messages.
-your pal
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.