Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  HOME    TRACKER    Visual Basic

Visual Basic 6.0 Image Handling

Hello friends,
I want to ask you a question about handling
the images with Visual Basic 6.0:
- There are functions in VB - Getchunk and AppendChunk
with which you can read and write binary image data to
records in a database (BLOB field) - this works fine.
- I have a form on which the user can choose a picture
with a dialog box. After the selection I need to store
the image in the BLOB field in the database, so I have
to convert the image data into binary variant which
could be written using the AppendChunk method. I don't
know how to do this!?
- The image has to be stored in a BLOB field, because
I use Crystal Report to show this picture, and, as far
as I know, there is no other way to show a picture that
changes in a CR.
Could you please help me... I lost too much time reading
forums on Internet and didn't find a solution for VB6,
only for
THX in advance,
Best regards,

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Visual Basic Image Handling
I need a simple routine that does the following:

Prompt user for inputting name of an image file.
Load image
Allow user to zoom into any part of the image while maintaining the aspect ratio.
Clear the image.
Return to top and load another image.


Visual Basic 6 Error Handling
Hi Expert,

I have a quick question regarding catching an error. Particularly PRINTER error. What I am trying to do is, to print out the Visual Basic Form. I do have an error handler. If the computer hooked up to a totally different printer, then error will get caught. HOWEVER, if I am hookep up to the correct printer, and for some reason the printer accidently disconnected, the error can not be caught. Please give me some suggestion. Here is the code:


Private sub print_form()
On Error GoTo err
Screen.MousePointer = vbHourglass
Frame1.Visible = False
Frame1.Visible = True
cmdPrint.Visible = False
cmdReprint.Visible = True

Exit Sub

MsgBox "Please try again! " & vbCrLf & "Error #:" & err.Number & vbCrLf &
err.Description, vbCritical, "WARNING!"

End Sub

File Handling In Visual Basic
Dear all,

I want to know whether File Handling is there in Visual Basic? If so means how to store data to Text file in Visual Basic. If anybody knows kindly reply immediatly. As per my need i want to write to file, and also i want to read that file.

Advance congrats


Handling .tif File From Visual Basic.

I want to open a tif file from my program and also get the total number of pages it has. How will I be able to do this?


EMbedded Visual Basic - Comm Handling
Hi friends,
I have an HP ipaq Pocket PC with windows mobile as operating system.
What I am trying to do is to make it communicate with an RS232 serial device(card reader) without the involvement of the host pc.
i.e, direct PDA to Device.
I have installed and configured all the eMbedded VB resources in my system and i am able to create and run normal applications from the PDA.
But I have only a cable which can be connected from the PDA to PC (this end is USB).
How can I proceed from this point? Is there any hardware connector is required?
Please help.

thanks in advance.

Thomas George

Error Handling-database And Visual Basic
i have a problem....
what i want to know is i have an application which displays pictures from a file
the path to the file is in the access database
but if i run the program and the picture is not in that allocated folder... i end up with runtime error 53.. file not found
so what i want to do is have a default picture in that folder so if the allocated picture is not available it will display that picture instead of runtime error..
Please hellp me!!

Error Handling-database And Visual Basic
i have a problem....
what i want to know is i have an application which displays pictures from a file
the path to the file is in the access database
but if i run the program and the picture is not in that allocated folder... i end up with runtime error 53.. file not found
so what i want to do is have a default picture in that folder so if the allocated picture is not available it will display that picture instead of runtime error..
Please hellp me!!

Handling Power Point Through A Visual Basic Application
Hai Everyone,
   I have a query and please hel me with this.I have to launch a vb application which can control the following conditions:
1. The application should have a button - "Launch PowerPoint" - clicking it
launches PP.
2. The application has a browse button to select only PP files. On clicking
it, it brings up a file selection dialog in which only the PP files are
enabled for selection. On selecting a file, it opens into PP.
3. The application has a "Play" button. On clicking this, the PP brings up
the slide show.
4. The application has a "Next" button. On clicking this, the PP proceeds to
the next slide in the presentation.
5. The application has a "Back" button. On clicking it, the PP goes back to
the previous slide.
6. The application has a edit field which takes only numbers. A check box
labeled "Custom Timing" enables or disables it. When enabled, the contents
of the check box is taken as the time separation between the slide changes -
if "Next" is not clicked by then. For e.g. if we enter 10 into the edit box
while the PP is playing the slide show, then if we do not press "Next" for
10 seconds, PP displays the next slide automatically. This you do by
changing the slide flow information of the presentation slides.

I badly need help in this regard please help me out.

Thanks and Regards

Image Map With Visual Basic 6.0
Hello everybody!

I have developed a GUI with corel drawn and now I want to bring it to Visual Basic to give the code behind the graphics, I have already export this image to visual basic and used the Image tool to do it, also I have tried with the Picture box, but now since they look like buttons that you can make click I want to map the image in a way that when you make click inside the border you can open other screen, this is a special image that has different shape from a comand button. I know it is related to image mapping but so far could not find so much about it and specially simple examples. It will be really helpfull to me if you can give me some hints or information related to it, thanks.

Animate An Image [Visual Basic.Net]
When i click on the stop animate button (button 2) VB.Net give me the error: "There is no source code available for the current location."

Sorry if it's a stupid question, i'm not really good at VB

My code:

Class Animation

Dim m_FrameCount As Integer
Dim m_Frames As New System.Collections.ArrayList

' Return the total number of frames
Public ReadOnly Property FrameCount() As Integer
Return m_FrameCount
End Get
End Property

' Return the bitmap of the specified frame, stored in the private ArrayList
Public ReadOnly Property Frame(ByVal index As Integer) As _
Return DirectCast(m_Frames(index), System.Drawing.Bitmap)
End Get
End Property

Public Overloads Sub Dispose()

End Sub

' ==================== PRIVATE MEMBERS ====================

' This method is raised when the current frame changes
Private Sub OnFrameChanged(ByVal sender As Object, ByVal e As EventArgs)
' if the m_Frames array contains FrameCount bitmaps,
' it means that the animation run through the end,
' and now it is starting from the beginning again, so stop it
If Done Then
Exit Sub
End If

' update the image to the new frame, and save it

End Sub

' Add the current frame to the private ArrayList of bitmaps
Private Sub AddCurrentFrame()
' create a new empty bitmap
Dim bmp As New System.Drawing.Bitmap(MIV.PictureBox1.Image.Width, MIV.PictureBox1.Image.Height)
' retrieve a canvas object that allows to draw on the empty bitmap
Dim g As System.Drawing.Graphics = System.Drawing.Graphics.FromImage _
(DirectCast(bmp, System.Drawing.Image))
' copy the original image on the canvas, and thus on the new bitmap
g.DrawImage(MIV.PictureBox1.Image, 0, 0)
' add the frame to the array
End Sub

' Return True when the class has extracted all the frames
Private ReadOnly Property Done() As Boolean
Return m_Frames.Count = FrameCount
End Get
End Property

' Stop the animation and dispose the open image object
Private Sub StopAnimate()
System.Drawing.ImageAnimator.StopAnimate(MIV.PictureBox1.Image, _
New EventHandler(AddressOf OnFrameChanged))

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
' throw an exception and exit if this is not an animated image
Dim fdl As New Drawing.Imaging.FrameDimension(MIV.PictureBox1.Image.FrameDimensionsList _
m_FrameCount = MIV.PictureBox1.Image.GetFrameCount(fdl)

' extract the first frame and start the animation to extract the other
' single frames
System.Drawing.ImageAnimator.Animate(MIV.PictureBox1.Image, New EventHandler(AddressOf _

Do ' wait until all frames are loaded
Loop Until Done

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
System.Drawing.ImageAnimator.StopAnimate(MIV.PictureBox1.Image, _
New EventHandler(AddressOf OnFrameChanged))

End Sub
End Class
EDIT: Ohhh.. i posted in not in the .Net forum.. admin/moderator, please move the topic.

Image Editing In Visual Basic
Hi all,

I am new to this forum. I have one question.

I have one image (jpg,gif,tif). I want to load that image and i have to place some text on the image and i have to save that new image into database. Is there any free (without any charge) tool for doing that in VB. I searched a lot. But i didn't find any . Please suggest me.


TIFF Image And Visual Basic
I'm trying to save a TIFF image in a Database SQL Server with a Visual Basic aplication , but I have many problems.
The first is that I don't know the equivalence between an Image field in SQL Server with the Visual Basic datatype. I think that I must do a convertion type when I open the TIFF file .... perhaps binary convertion ?
And the second is that I must send this TIFF Image to an ASP page but I have to convert this Image to JPG or GIFF format, and I don't know how can I do it.
Thank You.

Visual Basic With MS Access Image

what is the best component to use when you want to display an image in Visual basic if made used of an MS Access database to store the image? I have made use of the OLE component with the following code in order to upload the picture to the OLE component - but it does not want to show the image:

ON Error GoTo ET

strfilepath <> GetFile(Me)
If strfilepath <> "" Then
OLE1.SourceItem = LoadPicture(strfilepath)
End if
Exit Sub
Exit sub
End Sub

The idea is that when the user click on a button to add new record, he must complete all the fields - then when he get to final field where he must upload his picture, he must click on a button, search for his picture, upload and then click on update in order to write everything to a MS Access database.

Scanning Image Through Visual Basic
hello everyone,
I wana Visual basic program that will scan the image from USB scanner to the size of the picture mean also crop that image.
I need any activex or whatever you people suggest. I will be very thankful to you .

Visual Basic Image Object
I would like to store Images in a variable ie

DIM MyImage as Image

So far I have been unable to load the image from a disk file.
How is this done?

Edited by - denniskeeling on 10/14/2004 1:01:48 AM

How To Print Image In Visual Basic

I made a program which is working properly for display the record and showing it's related picture/image. Now I need to print the image along with it's details. So please guide.

Loading Gif Image Into Visual Basic Form
hi all,

i am adding a gif image in to vb forms through example

Private Sub Form_Load()
Picture1 = LoadPicture("C:Documents and SettingsAdministratorDesktopmoving_dots.gif")
End Sub

but by using this method image is not moving .its behaving like bmp image.
how can i do this
give me suitable answer

regards ,

abhishek mishra

Capturing Image From Webcam Using Visual Basic 6.0
Hi all,
I want to capture the images using webcam....and save to customer database.

No problem with storing and retrieving from database.
Can anyone suggest available options or new ideas to capture images using webcam.

Thanx in advance.

Character Recognition On An Image Using Visual Basic

I would like to know the possiblities of developing a ICR based software. i need that to read charaters on a tiff image. the matter that is on the image could be printed or hand written. printed or hand written letters are seperated in boxes. please help me in this reagrd

thank you


Storing Image In Postgre Sql Using Visual Basic
hi all
can any one telll how to store images in a postgresql database using visual basic as teh front end ???

How To Get Url Image Using Visual Basic 6.0 Dekstop Application?
How to get url images in picture box/image box using Visual Basic 6.0 dekstop application?

Plz Help me.....

Runtime Image Print In Visual Basic 6
Hi All

I am in trouble... I am using visual basic 6 and access 2003. I want to print a picture in run time Data report in vb. I am using rptImage control for this and code:-


but it is not working.......

Can any one give me the solution...........

Printing OpenGL Image From Visual Basic
I have developed an application in visual basic which uses opengl for rendering graphics.

Now I want to print the rendered image to printer. Unfortunately no help is available for visual basic.

Anybody out there to help me ?

Sample code will be of great help.


Image Control With Data Report (Visual Basic 6.0)! Thanks !
Hi all ,

I want to load an Image to Data report , But I can not use this method thi load it.
If .Item(i).Name = "imgPhoTo" Then
.Item(i).Pictrue = LoadPicture(strPhoto)
End If

It said that :
Object doesn't support this property or method.
Is there any way? Pls help me!
Thanks in advandce!

Tostore Image Or Picture In Ms Access Using Visual Basic
how to store a pic in ms access and add delete or edit the picture stored in the ms access database through visualbasic

How Can I Play A Animation Gif Image In Form In Visual Basic.
I want to display a animation gif image in a visual basic form. So I long the help from someones.
Thanks .
Luu Truong Huy

Save/Load Rich Text In/from Image Field (for Visual Basic 2005)

I want to save the content of a rich text box (also containing images) to an image field in MS SQL Server 2005 and also load this data back to a rich text box via ADO.NET.

(It is no problem to save/load the data to a file but this solution is not sufficient.)

Thanks for any help!!!

READ AND WRITE IMAGE FILE FROM/TO SQL SERVER Via Stored Procedure Using Visual Basic 6
Hi to everyone.

Would appreciate if you could provide the correct code on how to read and write an image file coming from sql server 7/2000 via stored procedures using Visual Basic 6 as the development tool.

thanks a lot .



Insert An OLE Image Bitmap In Access 2000 Database Via Visual Basic 6 ADO Controls...
i have quite a problem here...
i have to store a linked OLE Image Bitmap in Access database using my client application developped in VB6...running with ADO 2.6
I must be able to read and write to my table an image that exists on my hard drive.
I can't only store my image path because i have to use a linked image on one of my Access Report using a dependant object linked on this OLE type field which is an image...
If you know how to show an image on a Access Report changing with different field values (image path stored in string field)....please help me too! this could resolve my problem!!

if you have any suggestions or solutions....
i would really appreciate!!!!

Word And Visual Basic [ How Can I Get The Save As Window Through Visual Basic? ]
Hi, I made a small program in visual basic that with the use of

Dim oWord as new word.application
Dim oDoc as new word.document

fills a document with some data from the visual basic.
I want when those data are loaded in word the save or save as window to appear.
The command oDoc.saveAs saves the document without even asking for a filename.

What Can I do?

How Do I Run A Program I Made In Visual Basic On A Computer Without Visual Basic?
I created a program in Visual Basic and I was curious at what I needed to do to be able to install or use this program on a computer without Visual Basic. Any help would be great! Thanks in advance.

Extracting Visual Basic Source Code From Visual Basic EXE
hi everyone,

Well actually the problem in my case is that i had mad an EXE in VB6 around a week ago and had stored the EXE and th source code in two diferent folders. By mistake somebody ha deleted the source code folder. I wanted to make some changes i the EXE code and Now i have only the EXE folder to deal with.

Is there any method by which i can extract the Visual Basic cod from the VB EXE. Is there any application or software which ca help me in this? Do give me the hyperlink for downloading th EXE for the extraction if possible.

Please let me know at the earliest.

Thanks in advance.


Is Visual Basic Script As Ubset Of Visual Basic

Is visual basic script a subset of Visual Basic code?

Visual Basic Items Removed From Visual Basic.NET
A while ago (maybe up to a year) I had found a web page (probably a Microsoft MVP's home age) that had a list of about 100 things that were removed from Visual Basic in the transition to Visual Basic.NET. As it is, I would like to look at that again, but I can't seem to find it on my computer. Does anyone remember this page and/or have a copy of the link or the file that was on it. It has particular things like Debug.Print is no longer valid and MsgBox function is not supported. I've look on Microsoft's website and found a great deal of information about implementation difference, but I can't seem to locate this particular piece. If anyone could help I would appreciate it very much.

Thanks in Advnance

Nick August

Image Handling While Minimized?
hi guys,
i have written a VB app that loads an image and reads it to recognize some easy mono colored characters but VB cannot read it when minimized or there are some other programs over it. I see the reading function GetPixel or some similar one needs DC for the image box and x,y for the point, then why it needs to see it directly from outside-like style. if it sees like that then why should i send the DC? i should sendt the x,y and that function should read the x,y of the current 'screen' and return its color value. It does it that way because it cannot read when there is other fomrs over it but it also needs DC. isnt that strange? i need to make that read while minimized also. does anyone has any idea to do it and please tell me why it needs DC while it directly reads from screen x,y? (i mean it can use the screen dc if there is one, there should be i believe).


Image Exporting And Handling
While working with MSChart I've seen it has a method called "EditCopy" and then you can save it with SavePicture as a BMP. Is there some class module or plain module out there that would let me save the graph in other formats like JPEG, GIF, and/or PNG?

Also, is there any way of loading PNG files in a picturebox? without using some other non-standard OCX.

Handling Image In VB And Access
Dear Friends

I want to create a database which includes Images too. In access, OLE field can accept BITMAPS only, I want to put some JPEGS it is possible in Access. Also, I want to connect this OLE field in Visual Basic, No Control can hold, is this have any solution, that I can put images through VB

VBA Word Image Handling
I am working on converting Word to HTML tags. Don't know how to look for the image in Word document and then convert to img tag. Any Clues !

Basic Ini File Handling
Ok how do i simply read & write to a ini file? I tried:

Dim Ret As String, NC As Long
Ret = String(255, 0)
NC = GetPrivateProfileString(App.Title, "RootDir", vbNullString, Ret, 255, App.Path & "config.ini")
Text2 = App.Path & "" & Ret

But no luck. How do i specify the section and key i would like to get text from. i used to do it but forgot how,. btw im on VB6

Basic File Handling...
Okay, so I load a txt file with a location of a file (Ex - c: est.lts). What I want to do is check if the file c: est.lts is really there, and if it isn't, I want to let the user know...

I imagine this is pretty easy to do, but I just don't know...


Basic Form Handling

How do I get data from one form into the other?

This is what I have tried:

'from the dialog form
dim i as integer
i = frmMain.tabstrip1.selectedItem.index
msgbox i

I just cannot get the right tabindex from the main form. I cannot read anything from the main form, not even a simple textbox. I thought I could read it like frmMain.textbox. But this doesn't work.

Please help me.

Fwd: How To Disable Basic Functionality Of Back Space & Delete Key In Visual Basic
<html><div style='background-color:'><DIV>
<P><A href="" target=_top><IMG alt="Image by" src=" flamingtext_com_1057144048_20660.gif" border=0></A> <BR><BR>
<DIV>Try to use API's i am sure u will get ur problem</DIV></P>>Hi all
<DIV></DIV>> can any one tell how to disable back space & delete keys in perticular
<DIV></DIV>>text box.
<DIV></DIV>>thanks & regards,
<DIV></DIV>>Sridhar cs
<DIV></DIV>>*Manage Subscriptions:
<DIV></DIV>>*Leave Group:
<DIV></DIV>>*Questions: mailto: email@removed
<DIV></DIV>>*Terms of Use:
<DIV></DIV>>*Copyright (c) ITtoolbox and message author. No redistribution.
<DIV></DIV></div><br clear=all><hr>Add photos to your messages with <a href="">MSN 8. </a> Get 2 months FREE*.</html>

How To Disable Basic Functionality Of Back Space & Delete Key In Visual Basic
Hi all

can any one tell how to disable back space & delete keys in perticular
text box.

thanks & regards,
Sridhar cs

Image Handling ActiveX Controls

I have used an image handling control from Olympus S/w, called ImageKnife.
The functions provided by this one are good. But some do not work for Colored images.
So we have made the utility only for color depth. ie. Black and white.

I just want to know what other Image handling controls are in market and which can handle functions like
Overlapping one image on other, either complete overlap or transparent
selecting area on pict. or blacking out selection

Almost like Windows PaintBrush/PhotoShop. (The only purpose of making similar utility was that we provided symbols related to Telecom Network which can be inserted. )

etc etc

Please inform me if you have used any such control.



Rich Text Box Image Handling
Hi everyone,

The program I am writing has a rich text window showing particular types of
data message, and my plan is to insert a small BMP image before each message
depending on its type.

So far the images are showing up fine, but when you click the image it
allows you to resize the BMP to arbitrary dimensions.

Is there a way to gain access to the properties of these images at run time
to disable this behaviour? Or is there any way to redirect/ignore the click
event on these images?

I've successfully tried both the 'clipboard - paste' and 'OLEObjects.Add'
method to print on the RT Box but both behave the same way when you click an
image. Locking the text box has no effect either.

Any clues would be greatly appreciated.


Code Change From Visual - Visual Studio 2005
I am working on a tuturial that i have for Visual ( for now )

I am working with Visual Studio 2005.

I have been working on a code to change the text color by the name put into
the text box.

Visual Basic .Net code.
Label2.ForeColor = Color.FromName(TextBox1.Text)

i get the error
Name 'Color' is not declared.

I was wondering if someone can show me how things would be in Visual Studio.

thank you

Error Handling Basic Concept
Ok here's the simplified version of what Im doing.Using a Do While Loop, Im updating records from an excel worksheet into an Access DB. Problem is, that when I want to handle errors for Duplicate Records, it only handles trhe first error in this case. Once you get past the first error, Errorhandling doesnt work and Access Errors keep popping up.

VB Code:
Do While XYZ>yyz   ' Do for all rows in the Excel Worksheet         With rs                 ' Rs = Recordset ObjectOn Error GoTo DBErrHandler            .AddNew ' create a new record             .Fields("EquipID") = Range("A" & r).Value            .Fields("Description") = Range("B" & r).Value          End With        DBErrorResume:        r = r + 1 ' next row    Loop    rs.Close    Set rs = Nothing    db.Close    Set db = Nothing    Exit Sub 0DBErrHandler:   Select Case (Err.Number)           Case 3022              MsgBox Err.Number              rs.CancelUpdate                GoTo DBErrorResume

Difference Between Visual Basic And Visual
visual basic and visual
i am very new to programming, and i was wondering if someone could explain the difference between visual basic and visual i Know this may be a silly question to ask, but if i dont i will never find out.
i am designing a system for a chinese restaurant, hopefully i hope create it in Visual basic.
if anyone can help, i would be grateful.

Copyright 2005-08, All rights reserved