png轉bmp源碼
BMP是最簡單的圖形存儲格式,在c++里有朋友封裝了一個類CDib.
只要把圖片使用附件中編輯--粘貼來源找到圖畫打開另存為選擇你想要的格式保存就可以了。也可以右鍵點擊選擇打開方式使用圖畫打開相同的方法。另外photoshop 和office2003的picture manage也有這個功能。
Private Sub mnuconvertBMPtoJPG_Click()
Dim tmpimage As imgdes ' Image descriptors
Dim tmp2image As imgdes
Dim rcode As Long
Dim quality As Long
Dim vbitcount As Long
Dim bdat As BITMAPINFOHEADER ' Reserve space for BMP struct
Dim bmp_fname As String
Dim jpg_fname As String
bmp_fname = "test.bmp"
jpg_fname = "test.jpg"
quality = 75
' Get info on the file we're to load
rcode = bmpinfo(bmp_fname, bdat)
If (rcode <> NO_ERROR) Then
MsgBox "Cannot find file", 0, "Error encountered!"
Exit Sub
End If
vbitcount = bdat.biBitCount
If (vbitcount >= 16) Then ' 16-, 24-, or 32-bit image is loaded into 24-bit buffer
vbitcount = 24
End If
' Allocate space for an image
rcode = allocimage(tmpimage, bdat.biWidth, bdat.biHeight, vbitcount)
If (rcode <> NO_ERROR) Then
MsgBox "Not enough memory", 0, "Error encountered!"
Exit Sub
End If
' Load image
rcode = loadbmp(bmp_fname, tmpimage)
If (rcode <> NO_ERROR) Then
freeimage tmpimage ' Free image on error
MsgBox "Cannot load file", 0, "Error encountered!"
Exit Sub
End If
If (vbitcount = 1) Then ' If we loaded a 1-bit image, convert to 8-bit grayscale
' because jpeg only supports 8-bit grayscale or 24-bit color images
rcode = allocimage(tmp2image, bdat.biWidth, bdat.biHeight, 8)
If (rcode = NO_ERROR) Then
rcode = convert1bitto8bit(tmpimage, tmp2image)
freeimage tmpimage ' Replace 1-bit image with grayscale image
imgdes tmp2image, tmpimage
End If
End If
' Save image
rcode = savejpg(jpg_fname, tmpimage, quality)
freeimage tmpimage
End Sub
........... Add these defines and declarations to your Global mole ...........
' Image descriptor
Type imgdes
ibuff As Long
stx As Long
sty As Long
endx As Long
endy As Long
buffwidth As Long
palette As Long
colors As Long
imgtype As Long
bmh As Long
hBitmap As Long
End Type
Type BITMAPINFOHEADER
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
Declare Function bmpinfo Lib "VIC32.DLL" (ByVal Fname As String, bdat As BITMAPINFOHEADER) As Long
Declare Function allocimage Lib "VIC32.DLL" (image As imgdes, ByVal wid As Long, ByVal leng As Long, ByVal BPPixel As Long) As Long
Declare Function loadbmp Lib "VIC32.DLL" (ByVal Fname As String, desimg As imgdes) As Long
Declare Sub freeimage Lib "VIC32.DLL" (image As imgdes)
Declare Function convert1bitto8bit Lib "VIC32.DLL" (srcimg As imgdes, desimg As imgdes) As Long
Declare Sub imgdes Lib "VIC32.DLL" (srcimg As imgdes, desimg As imgdes)
Declare Function savejpg Lib "VIC32.DLL" (ByVal Fname As String, srcimg As imgdes, ByVal quality As Long) As Long
《圖像處理----做一個自己的photoshop》
大部分都是源碼,其中有bmp<-->jgep<-->GIF的代碼.
B. 如何把png格式圖片批量轉成bmp圖片,需要批量轉
批量將圖片格式轉成bmp的方法,支持png批量轉成bmp:
步驟1,打開工具中的軟體,點擊左邊功能區中最上面的「格式轉換」按鈕。
C. 怎麼將png格式轉換成bmp格式
最簡單的方法就是用【畫圖】工具打開圖片,然後另存為,即可選擇bmp格式,
D. 怎麼講png圖像轉換為bmp
打開ps軟體另存為,選擇好格式為bmp的就行了。
E. 怎麼將png格式圖片轉成bmp的
圖片格式批量轉成bmp的方法:
工具軟體:優速圖片格式轉換器
步驟1,打開工具軟體,點擊左邊功能區中最上面的「格式轉換」按鈕。
F. 如何將.png文件轉換為.bmp文件
直接改後綴也可以;或者將圖片導入到Fileworks中以BMP格式的圖片再到處一遍!
G. png轉bmp怎麼轉
你可以試一下用迅捷圖片轉換器來操作。它是一款功能豐富、操作簡單的轉換工具。我們只需將png格式的圖片添加進來∞再設置好轉換成bmp格式,軟體就會自行運作,將其轉換為bmp格式。
H. 請問怎麼將PNG形式的圖像轉換成BMP形式
如果是WINXP,就把PNG格式的圖象用「畫圖」打開,然後點「文件」→「另存為」,把「保存類型」改成BMP格式。
如果不是WINXP,那麼就把圖片用Photoshop之類的畫圖軟體打開,然後再改格式。
I. png圖片怎麼轉換成bmp
圖片轉換器。或者用電腦系統自帶的繪圖工具,打開png格式的圖片,然後另存為bmp格式就可以了