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

Open A Jpeg File


How to open a jpeg file from visual should be opened in imaging software.

Urgent pls..

View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Open Jpeg From Cab?
Is it possible to package a jpg in a cab and then open it with my activeX control? I'm using :
Open "C:whatever.jpg" For Binary Access Read As #MyFile

I want to do the same thing, but get the file from .CAB


Open, Rotate And Save Picture As JPEG
ok, I want to itegrate rotating pictures function into my fotoalbum program. I want to rotate pictures for 90 degrees of course.

I'm saving JPEG's directly from picturebox with intels JPEG processor.

I'm rotateing pictures using GetDIBits and SetDIBits functions (and using 2 different pictureboxes - I think it was BillSoo's idea).

The problem is, that I can not save a rotated image.

Do you have any other rotating algorithms?

I've attached this project file.

VBA Question: Open JPEG, Get Image Size
In VBA in ArcMap, I need to open a JPEG file and get its image size. I've added a reference to System.Drawing, so now I can at least Dim a variable as a Bitmap, but when I try to type in the Bitmap constructor specifying the file path, basically VBA doesn't recognize the syntax. What am I missing?


Jpeg -> Binary -> String -> Winsock -> Jpeg
I'm making a little program which controls the LPT port, and i've connected a webcam to it.
It save's shots as jpeg files in the appdir.
Now i cant get it to send the jpeg file trough winsock to my client!

this is a little bit of my server code:

VB Code:
...Dim FREEout As Integer        FREEout = FreeFile 'load the image into array to be sent        Open App.Path & " mpout.jpg" For Binary As #FREEout            ReDim DATAout(1 To LOF(FREEout))            Get #FREEout, , DATAout        Close #FREEout        If connected Then        Winsock1.SendData DATAout '"[camstream]" & DATAout & EOP 'send the image array        numSENT = numSENT + 1end if        End If...

and this is a little bit of my client code:

VB Code:
...ElseIf label = "ping" Then        If datar = "request" Then        On Error Resume Next        Winsock1.SendData "[ping]response"        End If        End IfElseEnd IfNext iLoopDim FREEin As IntegerIf bytesTotal > "60" Then    If Dir$(App.Path & " mpin.jpg") <> "" Then Kill App.Path & " mpin.jpg" 'delete old file if it exists    FREEin = FreeFile 'open file to save incoming pic data to    Open App.Path & " mpin.jpg" For Binary As #FREEin        Put #FREEin, , sData    Close #FREEin    numREC = numREC + 1    picIN.Picture = LoadPicture(App.Path & " mpin.jpg")    End IfEnd Sub

but (of course) it wont work.
the picIN picturebox stays grey, the tmpin.jpg image is invalid.
but the tmpout.jpg of the server is valid.

So here is my question:
is there a way to load the tmpout.jpg (the binary bits?) into a string, send it trough winsock with my "label", so the client can recognize the label and convert it back to binary and write the tmpin.jpg?

Automating A Jpeg File
Good Morning

Shopping for some help automating a jpeg file in V/B 6.

I have a picturebox on the left side of my screen. In it is a jpeg of a
tractor. Inside of the loop for my progressbar, I want to make the
tractor go across the screen like the progressbar. Initially I thought it would be easy by just incrementing the Left value for the picturebox.
That did not work. Any ideas to point me in the right direction?

Thanks for the help,

Resize JPEG File
I need to Resize JPEG files.
1. Open input file
2. Save output in 3 Different Sizes

I have no idea where to start, i am in no position to buy any VB addins.

Greatful for all help,


RAW File Conversion To Jpeg
Does anyone know how to do this from VB without using the Canon and Nikon SDKs - maybe using the Microsoft Raw Viewer dlls?

From Picture Box To JPEG File
id like to make a program that makes a screenshot every time you press a key and store it in a folder...
is it possible ?

Save Jpeg Into Mdb File
Could anyone tell me how can i save my jpeg file into the my database. I using acess as my database.

I believe there is a way using ADO to save or extract a binary into XML. Does anyone know how to do this?

Getting The Pattern On A JPEG File
how can i get the pattern on a JPEG file?
what is the syntax in getting the pattern in a JPEG file?
i am trying to compare the image on a JPEG file to another JPEG file.
its like finding the right JPEG file with the same pattern as the given JPEG file.
i have research on the internet. it seems like that the concept is to get a pixels of the image and store it in arrays.

but i dont know the syntax in vb. can someone help?

Jpeg File Properties
Is it possible to read a files properties. What I am particully intrested in is a jpegs pixel properties, which can be found in the exitif properties.

JPEG File Format
Could comeone give me/point me to a site/file that has a detailed JPEG specification, including listing all of its "blocks" and showing its compression algorithm?

Save DC As A JPEG File
Is there any control or class can save DC as a JPEG file?

Bmp To Jpeg File Conversion
i want to convert a .bmp file to .jpeg file. is there any function or control available to do this.

MS Publisher File To JPEG
I know you can manually do this conversion in publisher but is there any way to expose this function in VB?  A point in the right direction would be helpful.  Thanks. Swi

Jpeg File Attributes
Hi all,

i do have questionof JPEG files and their attributes. Since i'm having a digital camera i'm geting bored with the filenames pict001.jpg and so on. So what i like to is open the file read the attirbutes and select format and date and create a more meaning full name. This sits in an app with a user form and so on. I kow how to open files and update them but don't have experience in the jpeg world.

anyone that can help me with this?

Help - Jpeg File Format
Hi Gurus,

Can you tell me the where i can find the format of a 'Jpeg' file?

ie. BMP has a certain format of storing data. similarly Jpeg should also have.

I want to be able to convert an (3rd party) existing Jpeg format, to be displayed be a typical VB app.

Can anyone help, please? Any help on algorithms/dlls/ActiveX-servers will be appreciated. (But not complete products please!, I can't plug-in a Abode PhotoStop into my program :-) )

Thanks in advance...


GIF And JPEG File Different Format
It is possible to view all different format files of GIF and Jpeg file in IMAGE control.

Can you please tell me which file cannot be display and why?


Save Picture As JPEG File?
Is there a way to save a picture oblect as a JPEG file?

Running JPEG File In Photoshop
Now...All i that i need to to do is open a .jpg with adobe photoshop. I tried using the shell execute api but it opens it with windows image viewer. How can i open a specified jpg file with photoshop without it being the defualt program? I couldnt find it on here...and had no luck looking for some sample code on planetsourcecode...Any help would be great...

To Transfer An 600kb And Above Jpeg File Using Udp In Vb6
I want to transfer an image file (jpeg)of above 600kb using UDP protocol in vb6.thanks in advance

Image File Paterns (.bmp .jpeg .png)
Hi, I have a program that lets you browse documents to find pictures. It will show all the pictures in the folder you have currently selected, but it only seems to show .bmp images. How could I make it so it could see .jpeg .jpg and .png images types also? I have attached the form I am working with.

Reducing File Size Of Jpeg
ei gud day,
its me again, i always have a question, ^_^. Just want to know how can i reduce the file size of my jpeg image without resizing the picture. the dimension of my jpeg is in the range of 100 X 100 (not that sure, but very close to that size) and the file size is 120KB(not that sure again, but still close to that size). I just wonder why the file size is too big when i save it, because the usual(the one that i've seen) size of a jpeg image with that dimension is just 30 to 60 KB.

I don't want to resize the picture because i've already resize it(the original size is around 1000 X 1000).

Im not saving in a database, just in a folder.

JPEG's In Resource File - *RESOLVED*
Simple question......

What type of file would I need to use to hold a load of images? I have approx 46 images, which I can make into various formats - .gif, bitmap, jpeg etc... I want to put them all into one "file" so I can call them up when needed.



How Do I - Insert A Jpeg File Into An Sql Database
i need to insert an jpeg file into an sql database from vb code

i am using aspx web forms and code

i need to insert a jpeg that is created at runtime into an sql database
so i can load it into a dataset that will be used by crystal report for visual

i will either load the report or export it to .pdf

please can you help me solve my problem?

Word PrintPreview To Jpeg File
Is there any way to acces printpreview image and convert it to jpeg
file in MS Word? VB6 Microsoft Word 2000

How To Convert Jpeg File To Pcx Format?
Hi everyone!

I receive a jpeg file to a function and I want to convert it to pcx format through my application in VB.
Does anyone have an idea how to do it?
any code example?


Can I Convert Form To .jpeg File

I am VC++ programmer & new to VB. I want to save the child controls/the region in client rect to a bitmap file. Can I do this in VB? Thanks in advance.


Resizing A JPEG Image File
Does anyone know of a module, COM object, DLL, etc that will take a JPEG file, resize it and write it back out?

I've tried the ImageMagick libraries in C++ but they're horribly complicated, underdocumented and full of bugs it seems. I even tried the PerlMagick libraries which plum didn't work at all.

It'd be nice to have a COM object that does something like this, but I'd be willing to write my own VB object that uses the functions in a precompiled DLL even one of those even exists.

Any help would be appreciated. Thanks.

"to Transfer An JPEG File Using Winsock In Vb6
I want to send an JPEG file of 600kb and above using UDP protocol in vb6.I have to add a customised header and tailer also for that image.I tried sending it by reading it as binary data using PEN and get command.It was showing the error "Datagram is too large to fit into buffer".so,I tried splitting the file in 8000bytes and sending it.I was able to send but not able to receive it back and reframe the image.I am receiving only 8kb.I have to send using UDP only.Please post your suggestions or pragram tips.Thanks in advance.

How Large A Jpeg File Can A Picturebox Picture Contain?
I am trying to load a large map file, Map.jpg, (31MB) into a picture box. A search of vbclassic as well as MSDN help provided no applicable help. I'm using MS Me, a Picture box in a new project and using AutoSize = True

VB Code:
Private Sub Form_Load ()   Picture1.Picture = LoadPicture("c:pathfile1.jpg")End Sub

to load the file at run time. The program runs without error messages and gives a black picture box.

When I loaded the jpg file at design time, the picture box properties showed the height = 171060 and width = 132060. The picture box was black and no error messages occured.

I tried loading a smaller map file (384KB) and a protion of the file displayed OK. In another vb6 app I can scroll the entire 384K map using the cursor keys.

Any help would be appreciated including info on the largest picture file the picture property will hold and display with scrolling.



Write To Exif In A Jpeg File (vb6) [UNRESOLVED]
does anyone know of any free exif-writing command line programs/activex controls/dlls - i would like to edit the "Title" field of jpeg files. you can change this field by right clicking on the file and looking at advanced properties in the summary tag but this cannot be automated, as far as i am aware. there are also various graphical windows applications (exifer to name one) which do it but, again, they can't be automated as far as i know. i have found one command line utility ( but thisunfortunately has a 99 letter limit for a field(many of my captions are longer than this)

many thanks


Taking A Screenshot And Saving It As A File (bmp/jpeg Etc.)
hi, here's the thing:

i want Vb to make a screenshot and save it as a bmp/jpg/etc.

i already got this (see far down), but it just makes a screenshot:

so, can anyone help me?

thx in advance,

Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long

Private Sub Command1_Click()
Dim wScreen As Long
Dim hScreen As Long
Dim w As Long
Dim h As Long

wScreen = Screen.Width Screen.TwipsPerPixelX
hScreen = Screen.Height Screen.TwipsPerPixelY

Picture1.ScaleMode = vbPixels
w = Picture1.ScaleWidth
h = Picture1.ScaleHeight

hdcScreen = GetDC(0)

r = StretchBlt(Picture1.hdc, 0, 0, w, h, hdcScreen, 0, 0, wScreen, hScreen, vbSrcCopy)

End Sub

Read EXIF Tags In JPEG File
I'm looking for a VB6 method of reading EXIF tags in JPEG files (on WinXP).  Much surfing has turned up several 3rd party custom controls and DLLs, all offering much more that I need.  On every WinXP system I have used, Windows Explorer can read these tags (Properties | Summary), so the functionality/API is there somewhere.

Resource File, Adding Jpeg Or Standard Pictures?
Can you put jpeg, or standard picture formats in the resource file so you could use to view pictures instead of having to have the pictures seperate? What I mean is the pictures would compile into the .exe file. Can this be done and how?

Can I Load A Image File E.g. Jpeg Display In Msgbox?
Hi, how can i load a image file, e.g. jpeg format, display in msgbox ? Thank you.

Can't Open Object Using .aspx File. Can Open With .htm File
I’m trying to use vbScript to open an excel application (I’m also going to do word).

Sub Btn1_onclick()
    call OpenWorkbook("c: emp est.xls")
End Sub

Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub

This code works in a .HTM file but not an .aspx file.

I get this error -

Microsoft VBScript runtime error: ActiveX component can't create object: 'Excel.Application'

Why wouldn't it work in an .aspx file?


Open Dialog To Open Text File With Notepad?
Can someone please help me to open a text file with the Common Dialog control? I have seen your tutorial and it makes sense, but it uses a rtb control instead of opening the file with notepad as i would like.


(Other properties were setup in properties pages)

Private Sub Command1_Click()
cdlOpenFile.Filter = "Text File (*.txt)|*.txt|All Files|*.*"

End Sub


What Is The Line To Open A File.. Open ?????? For Input As #RecordFile
in my program i have this line, but it doesnt work

Open ("E:Visual BasicWork
ecord") For Input As #Filehandle1

but i says bad file name or number "error 52"
what am i supposed to type without using commondialog boxes etc

Open Excel And Make It Open A Text File
Hey, friends,

I need to open excel, make it open a comma delimited text file, format it, and after that, end my application leaving the user in excel... i am starting as follows but at that point, excel does not appear, why? (it seems to work but i can not see excel)


Dim XlApp As Excel.Application
Set XlApp = New Excel.Application
XlApp.DisplayFullScreen = True

Thanks for your help!


AutomationError While Attempting To Open A File With
I am getting an AutomationError while attempting to open a file with method with the word.application object. Below is the code I am using. Oooo its frustrating when something as easy as opening a file gets you.
Dim wb As New Word.Application
'Notice here I attempted using the document object
'and assigning it but without success hence the '
'Dim wbDoc As Word.Document
Set wb = New Word.Application
' Set wbDoc = CreateObject("Word.Document")
wb.ChangeFileOpenDirectory ImportDir
wb.Documents.Open FileName:=iFileName, ConfirmConversions:=False, Visible:=True
my file is not a word file so I am turning the confirm conversion to false. the file name is rt010117.034. It is a very simple text file with page breaks hence the desire to open with word.


WMI Read Open Mode Column In Open File From MMC

I have a requirement to capture whether the user is reading a file or modifying a file in a network share.

I have used resource.path and resource.user to get "Open File" column and "Accessed By" Column under Open Files in Shared Folder of MMC, that details what share is accessed and who accessed it.

Is there a way to capture, what the user is doing whether he is reading or writing to a file. This information is captured under "Open Mode" column in Open Files option.

Can anyone guide me how I can extract this infomation.


Detecting Adobe Reader Open With PDF File Open
I use this to close Adobe Reader if the instance of Adobe Reader is open blank (no PDF file Open). How do I detect an instance of Adobe Reader that is open with an unknown PDF file open? Adobe Reader open blank returns a handle base on the window title Adobe Reader. Adobe Reader open with a PDF file open returns a handle base on What ever PDF file that is open.pdf Adobe Reader. Appears I need to read the window title. But how?

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal _
lpClassName As Any, ByVal lpWindowName As Any) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam _
As Long) As Long
Dim iHwnd As Long

'close a window
On Error Resume Next
sTitle = "Adobe Reader"
iHwnd = FindWindow(0&, sTitle)
If iHwnd > 0 Then
iReturn = PostMessage(iHwnd, WM_QUIT, 0&, 0&)
End If

How To Open The Open File Dialogue Box In The Same Directory?
How do I open the Open File Dialogue Box in the same directory as the program exists?

Using The Open Statement To Open A Text File
Can I enter the pathname as a relative path or do I have to open it with an absolute path?

Open Dialog - Open Folder Not File
I need to select a folder to work in, but the common controls only allow me to select a file. This will not work since the folder I want to work in only has other folders in it. Is there a way to select a folder instead of file in an open dialog?

MD5 An OPEN File Or Get Filedata From An Open File
I want to MD5 an open file but the problem is I can't read the file info when it's openend , but I can't close it cause it's an exe and I'm not the one who opens it as first but I only want to read the data and md5 it

Error "invalid Method " When Im Using To Open Movie File With Mp.Open Plist.list(0)
Any 1 tellme how this error occure
i m using open command to open movie file from list box
but movie play also give me error " Invalid Method" using this code plist.list(0) ' here this line give error'

in this method playstatus = mpPaying condition is not working if i open file with mp.FileNme = plist.list(0) then above condition works fine

so pleaee tell me accept mediaplayer any way to play all movie file from list box

Copyright 2005-08, All rights reserved