Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Bitmap C# VB.NET

Solved!
Go to solution
Hi,
I work under Visual Studio 2008 and IMAQ 8.5. I perform some FFT analysis on images with that ease that anyone uses IMAQ could tell. I tried to save the image resulted using CWIMAQ.saveimagetodisk "filepath", unfortunately, it keeps telling me that I don't have any interface on my machine (I take photos from my hard dsik and perform the analysis. I resorted to use CWIMAQVision.WriteBMPFile method but the colour results was awful (very dark green and black background).
 
I thinks this problem is easy to be regenerated.If not, I can post the program that I made. Thanks to all the community's help 
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 1 of 6
(8,104 Views)
Can you post ur program?
Message 2 of 6
(8,090 Views)
Solution
Accepted by topic author wbadry
The basic image-saving method is CWIMAQVision.WriteImage , I'll include the reference help for the method.

WriteImage Method
Syntax
CWIMAQVision.WriteImage SourceImage, Path, Format [, ColorPalette]

Return Type
Long
On success, this method returns 0. On failure, this method returns a negative number.

Purpose
Writes an image to a file.

Remarks
Use this method with all image types. The following table indicates the image types that each image file format supports.

File Types Image Types
AIPD all image types
BMP, JPEG 8-bit, RGB32
TIFF 8-bit, 16-bit, RGB32, RGBU64
PNG 8-bit, 16-bit, RGB32, RGBU64
JPEG2000 8-bit, 16-bit, RGB32, RGBU64

This method does not write overlay information, calibration information, pattern matching template information, or custom data to the file. To write this data, use CWIMAQVision.WriteImageAndVisionInfo.

Parameters
SourceImage As CWIMAQImage
The image to write to a file.

Path As String
The name of the file.

Format As CWIMAQFileFormats
The standard file format to create. If this value is cwimaqFileUnknown, the method creates a file with the BMP file format.

ColorPalette As Variant
[Optional] A CWIMAQPalette object that defines a color table to associate with 8-bit images. Do not provide this input to write a grayscale palette to the file.

Example
Private Sub Run_Click()
    Dim Filename As String
   
    'Write an image in Viewer1 to a JPEG file.
    'The name of the file is in Filename.
    CWIMAQVision1.WriteImage CWIMAQViewer1.Image, Filename, _
                            cwimaqFileJPEG, CWIMAQViewer1.Palette
End Sub

Chris Bolin
LabVIEW Partner Program, CLA
Message 3 of 6
(8,077 Views)
Sorry for taking so long to mark this answer. The E-Mail notification is not working with me. I don't know the reason. I tested everything. I noticed that the "Subscribe to thread" doesn't exist in the thread options
Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

Message 4 of 6
(6,285 Views)

 


I noticed that the "Subscribe to thread" doesn't exist in the thread options

 

 

Did you login, Sign in and then check for the option?

Message 5 of 6
(6,242 Views)

Yes Muks I made sure that I'm signed in. Worse still is that when I choose from options, "Subscribe to message", it doesn't add it to my preferences.

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 6 of 6
(6,229 Views)