Forum | | | | - Page 1 - |
| Georg Hovenbitzer | Hello together,
me erdrückt straight a gigantic Wissenslücke what about me hope your can me help on. target is it, one Image To loading, it to a Thumbnail To verkleiner and then in a data base to take off. my trouble is now the part between Thumbnail and Database and there the, How I a Speicheradresse / aray the Bildes and which Size come: as Presentation have I the geile GDI+ demonstration of Andreas taken.
$H \windows.ph
$H \includes\Functions_GDIPLUS.ph
$H \includes\GDIP_Imageging.ph
$I \includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,ImageWidth&,ImageHeight&,GraphicObject&
Declare hPic&
Declare imgThumb&
Declare lngImage&
Declare hBitmap&
Window 0,0-1024,786
Cls ~GetSysColor(~COLOR_3DFACE)
gdiplusToken& = InitGDIPlus()
hPic& = @Create(hPic,-1,Image.jpg)
~GdipCreateBitmapFromHBITMAP(hPic&,0,@Addr(lngImage&))
~GdipGetImageThumbnail(lngImage&,92,69,@Addr(imgThumb&),0,0)
~GdipCreateHBITMAPFromBitmap(imgThumb&,@Addr(hBitmap&))
DrawPic hBitmap&,50,50;0
here bräuchte I now something, what me a address or aray and which Size determined !!!
WaitInput
DeleteObject hPic&
DeleteObject hBitmap&
~GdipDisposeImage(imgThumb&)
~GdipDisposeImage(lngImage&)
ExitGDIPlus(gdiplusToken&)
End
|
| | | Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 02/02/09 ▲ |
| |
| | | | - Page 2 - |
| | Georg Hovenbitzer | Hello Pascal,
I have still said, this is a interesting Possibility To your question whether it border gives, here the original Text from the SQLite Homepage:
Supports terabyte-sized databases and gigabyte-sized strings and blobs.
there has one sooner a problem with Plattenplatz, as with the what into Blobs verstauen wants. One disadvantage has The DLL tappt im dunkeln can't code, what but time again whom Exportgesetze together hang might. but I have already a Page found a Verschlüsselung in the Source installed is and one the DLL new Compilieren must.
After appeal of SaveJpgToMem finds itself the complete code the new erstellten JPG in PicData#. sure yet verbesserungsfähig,but so could one already what begin..
it works, it works I see no compel improvement, there it very whom lane goes How the VB demonstration. The ausgiebige Test comes tommorrow and hereon freue I already.
super many Thanks !! |
| | | Viele Grüsse, Georg Hovenbitzer(Windows XP Pro, XProfan 11.2, Profan2Cpp 1.6a) | 02/04/09 ▲ |
| |
| | Uwe ''Pascal'' Niemeier | Hi people!
Georg
I see no compel improvement, there it very whom lane goes How the VB demonstration.
the can I not me sit let
here a improved Version, with the altogether only one Stream is used, the too to Rüchverwandlung data > Image herhält and on the End of program too Correctly again removes becomes. means quasi one round about-carefree-pkg, the on the side too a virtually function hat; it can as Preview for differently Kompressionsraten with JPG use CompileMarkSeparationwindow 0,0-600,500
$H windows.ph
--GDIPlus-Erweiterungen von Andreas Miethe
$H Functions_GDIPLUS.ph
$H GDIP_Imageging.ph
$I GDIP_Helper.inc
--Funktionen aus shlwapi.dll unter XP (SP3) nur indirekt per Ordinal erreichbar
var shlwapi&=~GetModulehandle(shlwapi.dll)
var SHCreateMemStream&=~GetProcAddress(shlwapi&,12)
var IStream_Write&=~GetProcAddress(shlwapi&,212)
var IStream_Reset&=~GetProcAddress(shlwapi&,213)
var IStream_Size&= ~GetProcAddress(shlwapi&,214)
var IStream_Read&= ~GetProcAddress(shlwapi&,184)
proc StreamRelease-------------------------------------StreamRelease
var VTable&=long(IStream&,0 )
var Method&=long(VTable&,8 )
call(Method&,IStream&)
endproc-------------------------------------------------------------
proc StreamToMem-----------------------------------------StreamToMem
declare Size&
call(IStream_Size&,IStream&,addr(Size&))
dim PicData#,Size&
call(IStream_Reset&,IStream&)
call(IStream_Read&,IStream&,PicData#,Size&)
endproc-------------------------------------------------------------
proc MemToStream-----------------------------------------MemToStream
call(IStream_Reset&,IStream&)
call(IStream_Write&,IStream&,PicData#,sizeof(PicData#))
endproc-------------------------------------------------------------
Proc SaveJpgToStream---------------------------------SaveJpgToStream
--Modifizierte Variante der SaveAsJPG-Prozedur von Andreas Miethe
Parameters Bitmap&,Quality&
Declare encoderCLSID#,result&
result& = 0
Dim encoderCLSID#,16
Declare encoderParameters#
Declare wTemp$,encoder#
wTemp$ = S2WS(~EncoderQuality)
Dim encoder#,16
IIDFromString(ADDR(wTemp$),encoder#)
Dim encoderParameters#,32
Long encoderParameters#,0 = 1
MoveMemory(encoderParameters#+4,encoder#,16)
Long encoderParameters#,20 = 1
Long encoderParameters#,24 = ~EncoderParameterValueTypeLong
Long encoderParameters#,28 = ADDR(Quality&)
If GetEncoderCLSID(image/jpeg,encoderCLSID#)
call(IStream_Reset&,IStream&)
~GdipSaveImageToStream(Bitmap&,IStream&,encoderCLSID#,encoderParameters#)
result& = 1
Endif
Dispose encoder#
Dispose encoderParameters#
Dispose encoderCLSID#
Return result&
EndProc-------------------------------------------------------------
external(ole32,CoInitialize,0)--OLE initialisieren
var Token&=InitGDIPlus()------------GDI+ initialisieren
usermessages 16---------------------WM_CLOSE abfangen
declare PicData#,IStream&--PicData# und IStream& global deklariert!
IStream&=call(SHCreateMemStream&,0,0)--Stream erzeugen
var Pic&=create(hPic,-1,C:1TestBild.jpg)--Demo-Bild (Pfad anpassen!)
declare Image&,Thumb&
~GdipCreateBitmapFromHBITMAP(Pic&,0,addr(Image&))--------Image von Bitmap
~GdipGetImageThumbnail(Image&,250,250,addr(Thumb&),0,0)--Thumb von Image (Größe 250*250)
~GdipDisposeImage(Image&)--------------------------------Image freigeben
deleteobject Pic&----------------------------------------Bitmap freigeben
SaveJpgToStream(Thumb&,5)----Thumb als JPG (schlechte Qualität) nach IStream&
StreamToMem()----------------JPG-Daten von IStream& nach PicData#
var LoQuality$=char$(PicData#,0,sizeof(PicData#))--PicData# als String zwischenspeichern
SaveJpgToStream(Thumb&,100)--Thumb als JPG (gute Qualität) nach IStream&
StreamToMem()----------------JPG-Daten von IStream& nach PicData#
var HiQuality$=char$(PicData#,0,sizeof(PicData#))--PicData# als String zwischenspeichern
declare Handle&,Bmp&
char PicData#,0=LoQuality$--Daten aus String nach PicData#
MemToStream()---------------Daten von PicData# nach IStream&
~GdipLoadImageFromStream(IStream&,addr(Handle&))----Image aus IStream&
~GdipCreateHBITMAPFromBitmap(Handle&,addr(Bmp&),0)--Bitmap aus Image
~GdipDisposeImage(Handle&)--------------------------Image freigeben
drawpic Bmp&,10,10;0--------------------------------Bitmap anzeigen
deleteobject Bmp&-----------------------------------Bitmap freigeben
char PicData#,0=HiQuality$--Daten aus String nach PicData#
MemToStream()---------------Daten von PicData# nach IStream&
~GdipLoadImageFromStream(IStream&,addr(Handle&))----Image aus IStream&
~GdipCreateHBITMAPFromBitmap(Handle&,addr(Bmp&),0)--Bitmap aus Image
~GdipDisposeImage(Handle&)--------------------------Image freigeben
drawpic Bmp&,270,10;0-------------------------------Bitmap anzeigen
deleteobject Bmp&-----------------------------------Bitmap freigeben
while 1
waitinput
case %umessage=16:break
endwhile
StreamRelease()---------------------Stream freigeben
external(ole32,CoUninitialize)--OLE aus
ExitGDIPlus(Token&)-----------------GDI+ from
PS: The question to the maximalen Datenlänge related eigendlich on The @Decode64() -function, because iF the so betonte. so ließe itself JPG in DB namely too for conventional DBs (Memo-boxes or so) benefit.
SeeYou Pascal |
| | | | |
| | | in this example go correctly 10MB To 13MB To 10MB konvertiert by encode64 and decode64. CompileMarkSeparation |
| | | | |
| | | wished time of of my Bmp-File(64x64Pixel) The RGB-values read. the Image has 3 different waagerechte Farbstreifen(RGB). it come utterly incorrect values 31 0 31, 227 0 227 etc.
though pure RGB-values come should 255 0 0, 0 255 0, 0 0 255 zb.
window 30,30-500,500
$H windows.ph
declare bmi#,b#
declare Pic$,Handle&,Neu&,wert&,hwin&
Window 20,20-200,200
hWin& = Create(Window, %hWnd, Test, 250, 20, 650,500)
Pic$=Test.bmp
Handle&=create(hPic,-1,Pic$)
struct bmpHEADER=Size&,Width&,Height&,Planes%,BitCount%,Compression&,SizeImage&,X#(24)
dim bmi#,bmpHEADER
bmi#.Size&=sizeof(bmi#)------------------Size of BITMAPINFOHEADER
~GetDIBits(%hdc,Handle&,0,0,0,bmi#,0)--Dummy-appeal, circa bmpHeader To fill (Return: 1=OK)
print sizeof(bmi#)
dim b#,bmi#.SizeImage&-----------------area for Bildinformationen (Pixel) provide
~GetDIBits(%hdc,Handle&,0,bmi#.Height&,b#,bmi#,0)--Eigendliche Bilddaten from lever detect
Neu&=~CreateDIBitmap(%hdc,bmi#,4,b#,bmi#,0)------new DIB with modified colours produce
startpaint hwin&
drawpic Neu&,10,10;0
endpaint
wert&=bmi#.SizeImage&
whileloop 0,wert&,4
print byte(b#,&loop),byte(b#,&loop+1),byte(b#,&loop+2)
sleep 10
endwhile
|
| | | | |
| | Jörg Sellmeyer | have Thou The Bitmap already with a external Program screen? If I einfarbige Bitmaps einsetze, go The values correctly outputted. here's my Bitmap
|
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/05/09 ▲ |
| |
| | | The values have I by me screen, having any the value 255 in R, G and B. with 2 Grafikprogrammen : Paintshop and Micrografx.
mfg |
| | | | |
| | | by me not. first comes of course 0 248 0 8x then again 224 7 224 8x and 31 0 31 8x the until schluss.
Zeig time your Ausleseprogramm.
mfg |
| | | | |
| | | Wohlbemerkt The values imho not stature RGB separate BGR exist. |
| | | | |
| | | playing now in the Test no role, derweil each colour the value 255 particular has. at least must the really with of/ one small Fluctuation seperat rauskommen and not these spending supra. Perhaps is my Aufrufreihenfolge wrong...
mfg |
| | | | |
| | Jörg Sellmeyer | Peter Bierbachh
by me not. first comes of course 0 248 0 8x then again 224 7 224 8x and 31 0 31 8x the until schluss.
Zeig time your Ausleseprogramm.
mfg
which Ausleseprogramm? I habs with your code read. The Bitmap is with CorelDraw prepares. Zeig still time your Bitmap. |
| | | Windows XP SP2 XProfan X4... und hier mal was ganz anderes als Profan ... | 03/05/09 ▲ |
| |
| | | in the attachment are The Bitmap.
mfg |
| | | | |
| | E.T. | even (because of yet-not-sleep-can ) time probiert: Test1 and Test2.bmp show by me each 255 (remainder 0) for jeweilige colour on (Photoshop and AutoCad). likewise The bmp of Jörg.
The in the o.g. Source used Test.bmp is well not thereby or has at Upload whom name changed ?? |
| | | Grüße aus Sachsen... Mario WinXP, Win7 (64 Bit),Win8(.1),Win10, Win 11, Profan 6 - X4, XPSE, und 'nen schwarzes, blinkendes Dingens, wo ich das alles reinschütte... | 03/06/09 ▲ |
| |
|
AnswerTopic-Options | 19.385 Views |
Themeninformationenthis Topic has 7 subscriber: |