Hi guys, I'm having problems converting .bmp to .jpg using vb6. :icon_question:The idea is to convert .bmp to .jpg so i can import the saved image to a pdf file for email and/or printing. I downloaded code that's supposed to convert .bmp to .jpg, but I get a compiler error saying I need to "specify user-type". :)Any help would be appreciated. ---Here's the code--- [CODE]Dim tmpimage As imagedes 'Image Descriptors Dim tmp2image As imagedes Dim rcode As Long Dim quality As Long Dim vbitcountcount As Long Dim bdat As BITMAPINFOHEADER 'Reserve space for BMP struct Dim bmp_fname As String Dim …

Member Avatar
Member Avatar
+0 forum 8

#include <stdio.h> #include <conio.h> #include <stdlib.h> #include <process.h> #include <string.h> #include <math.h> int count = 0; typedef struct bitmap24 { unsigned char header[54]; unsigned char* pixels; }BMP; void readBMP (char* filename) { int i; FILE* f = fopen(filename, "rb"); FILE* f1 = fopen("save.bmp", "wb"); FILE* pixelVals = fopen("vals.dat", "w"); unsigned char bmppad[3] = {0, 0, 0}; if (!f) { printf("Could not read file!\n"); exit(0); } unsigned char info[54]; fread(info, sizeof(unsigned char), 54, f); int width = *(int*)&info[18]; int height = *(int*)&info[22]; unsigned char *img = NULL; if (img) free(img); img = (unsigned char*)malloc(3*width*height); memset(img, 0, sizeof(img)); fwrite(info, sizeof(unsigned char), 54, …

Member Avatar
Member Avatar
+0 forum 1

Hi programmers, I am a c# programmer but I have a very big project in C++ (Which I am not familiar with) and I am facing a big problem. As part of the project, I need to convert the image (any image of any type bmp,jpeg,png...etc) to grayscale using openMP. After doing some research, I got the main method which allows me to do the conversion using openMP, it's as follows: // pDest is an unsigned char array of size width * height // pSrc is an unsigned char array of size width * height * 4 (32-bit) // To …

Member Avatar
Member Avatar
+0 forum 21

The code below should be extracting the pixel data from the mapProvinceFile bitmap specificed and placing it into a byte array, modifying some of that color data depending on the contents of a custom ArrayList, vertically flipping the image, and then displaying the resulting modified image in a new pane. Unfortunately, the image which is recreated appears to be identical to the original (apart from being flipped). This occurs despite the modified byte array being inside a databuffer which is used as the input for a raster which the resulting image then has applied to it by way of 'setData(raster)'. …

Member Avatar
Member Avatar
+0 forum 6

I need to load a BMP into C++ and code a program to convert it into a JPEG. I have very little programming experience and am wondering what libraries should be used to efficiently convert an image in this way. Is there a library that will convert the BMP straight to a JPEG? Or is it the case that the file will need to be loaded in and the data displayed in an array from which the calculations on that array will take place? Any help is greatly appreciated.

Member Avatar
Member Avatar
+0 forum 3

So, I want to save an HBITMAP to different image file formats like BMP,PNG and JPEG. I believe that the most simple way to do it is by using GDI+. So here is what I came up with. [CODE]Gdiplus::Bitmap bmp(hbmpImage,(HPALETTE)0); CLSID pngClsid; GetEncoderClsid(L"image/png", &pngClsid); bmp.Save(L"D:\image.png",&pngClsid,NULL);[/CODE] The problem is that it doesn't work, and I get a bunch of errors "error LNK2019: unresolved external symbol". I got [URL="http://msdn.microsoft.com/en-us/library/ms533843%28VS.85%29.aspx"]GetEncoderClsid()[/URL] function from MSDN, but I don't believe that this is the problem. Probably it's something else something I'm missing or something I don't know. I tried to do it the old way but …

Member Avatar
Member Avatar
+0 forum 1

I am having some major issues with OpenGL textures. I have the following code to load a glTexture (typedef ed as a GLuint): [CODE]glTexture LoadBMP(const char *fname) { HBITMAP hBMP; BITMAP BMP; glTexture texid; glGenTextures(1, &texid); hBMP=(HBITMAP)LoadImage(GetModuleHandle(NULL), fname, IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION | LR_LOADFROMFILE ); if (!hBMP) return NULL; GetObject(hBMP, sizeof(BMP), &BMP); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glBindTexture(GL_TEXTURE_2D, texid); // Bind To The Texture ID glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); // Linear Min Filter glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); // Linear Mag Filter glTexImage2D(GL_TEXTURE_2D, 0, 3, BMP.bmWidth, BMP.bmHeight, 0, GL_BGR_EXT, GL_UNSIGNED_BYTE, BMP.bmBits); DeleteObject(hBMP); // Delete The Object return texid; // Loading Was Successful }[/CODE] It works but …

Member Avatar
Member Avatar
+0 forum 6

Hi , I'm an amateur programmer from India. I use code::blocks for my c/c++ programming. I would like to create a simple 16color bitmap file reader in c++ . The hraphics library I use is winbgim . I'm a very beginner in graphics programming. I just know how to set color to pixels ... I dont want you people to give me any codes , but just help me understand the bitmap format so that I can read and display the image .. Please help me.. Suggest some online pages which will help me learn all about bmp file format …

Member Avatar
Member Avatar
+0 forum 1

Need help with a program (console application in Lazarus) I need to load a bitmap (bmp) file in FPC and be able to directly edit the pixels (their colour). I then need to be able to save the bitmap again with the same name. Please put as many comments into the code as possible to explain it! Thanks in advance :)

Member Avatar
+0 forum 0

Hi, I've got some trouble opening files saved by The Gimp in BMP 16bits 565. I've test some various bmp they all work except those saved from The Gimp and I really don't know why the format might be different from the one found there:[URL="http://wvnvaxa.wvnet.edu/vmswww/bmp.html"]http://wvnvaxa.wvnet.edu/vmswww/bmp.html[/URL] Bleu.bmp and Mire.bmp are some files that can't be show properly while test16bf565.bmp can be open. I've written a little program that load BMP and show them by a label with a pyQt window. It looks like this : [CODE=python] from PyQt4 import QtGui, QtCore import sys, os class Ui_ShowBmp(QtGui.QMainWindow): def setupUi(self, ShowBmp): ShowBmp.setObjectName("ShowBmp") ShowBmp.resize(660, …

Member Avatar
Member Avatar
+0 forum 2

I should write a program to combine the huge number of images side-by-side. The source images are jpeg and png formats images. I think no any direct way to combine png or jpeg images to gather, unless first convert them to bmp, or any raw format, and perform combination and finally convert the new image to jpeg or png format. Because of huge count of images (about 100000 images), I cant use standard available tools, that uses main memory. I should make all of operations on hard disk. Then I should write entire needing code. I need any information about …

Member Avatar
+0 forum 0

Type BITMAPFILEHEADER bfType As Integer bfsize As Long bfReserved1 As Integer bfReserved2 As Integer bfoffbits As Long End Type Type BMPInfoHeader biSize As Long biwidth As Long biheight As Long biPlanes As Integer bibitcount As Integer biCompression As Long bisizeimage As Long biXPelsPerMeter As Long biYPelsPerMeter As Long biClrUsed As Long biClrImportant As Long End Type

Member Avatar
Member Avatar
+0 forum 7

Hi guys First post on this website, so go easy on me. I'm a fairly inexperienced programmer, mostly using snippets of other people's code and adapting it for my own uses, but I have found a problem. I want to change my desktop programatically, but to a picture on the internet, not on my hard drive. I have included my current code. Is there anything I have to change to make it work, like an addition to the url of the picture? The code compiles fine, but it just changes my desktop to grey instead of the image. Also, it …

Member Avatar
Member Avatar
+0 forum 1

The End.