Forum | | | | Thomas Freier | Irgendwie habe je un Problem. J'ai pensé avec DrawPic H, X, Y; N1[, N2] et cela Handle einer Bitmap peux z.B. cela Ergebnis qui Funktion @Créer(«PCSI»,...) ou bien ... pourrait je aussi *.png verwenden ou bien liege je avec folgendem Skript fasch? KompilierenMarqueSéparationDeclare bereich#,x&,y&,z&,p&,text$
Def GetSysColor(1) !"USER32","GetSysColor"
SetTrueColor 1
Proc CatchBmp
Parameters MemPointer&
Declare hDC&, BITMAPFILEHEADER#, BMPInfo&, init&, hImage&
hDC& = External("user32.dll", "GetDC", External("user32.dll", "GetDesktopWindow"))
Dim BITMAPFILEHEADER#, 14
BITMAPFILEHEADER# = MemPointer&
BMPInfo& = MemPointer& + 14
init& = MemPointer& + Long(BITMAPFILEHEADER#, 10)
hImage& = External("gdi32.dll", "CreateDIBitmap", hDC&, BMPInfo&, 4, init&, BMPInfo&, 0)
External("user32.dll", "ReleaseDC", External("user32.dll", "GetDesktopWindow"), hDC&)
Dispose BITMAPFILEHEADER#
Return hImage&
EndProc
*** Hier stehen die Bilddaten aus bmp direkt im Quellcode.
Erstellt am 21. Februar 2010 mit dem XProfan Datengenerator, (C) Frank Abbing
Datei: E:profanXDatengeneratoricon4.bmp (originale Dateigröße: 1334 Bytes)
Declare mem#
Dim mem#,1336
Clear mem#
Long mem#,0=87444802
Long mem#,8=70647808,2621440,1048576,1048576,65536,8,16777216
Long mem#,44=16777216
Long mem#,52=-617349120,-617283329,-634060545,-600571649,-600637185,1545142527,-600506244,-583728897,1545142527,-583794563,-96861953,-432537345,-517537537,-264765185,-567017217,-130416385,-735444737,2082734335,2099445904
Long mem#,128=1533280402,-449380262,1478230271,-231210905,-971570945,-904593153,-971636481,-550174465,-550108929,-298319617,-566886145,1853423871,-382271382,1533083903,-585695137,-1190199041,-482934535,890568959,-499711937
Long mem#,204=1782513919,1617625218,-516489122,-197525249,-533200641,1566376191,1882980448,1899692172,1966538895,-600768363,1364721919,-1474887602,-1005256476,-415891202,-130481921,-853278465,-551288577,1092223231,-1558773674
Long mem#,280=-1491861280,-2025979675,-534183766,1396703487,1545076828,1819672702,-399048596,-500891393,1578762495,1075314814,1262420043,1634140244,-466288542,1920925951,-1474887569,705954021,-921370575,-650837761,-667614977
Long mem#,356=-482868993,1562050815,-348716931,-718601985,-365494017,-466222849,-214368001,-1875246849,-466091852,1664811263,-382205834,1948385535,-365363065,-786038529,-583663361,-483000065,-1305673473,-706477877,-1407647534
Long mem#,432=-499777302,-516554497,-925433601,1904017605,-113639311,-874970881,1259995335,739508310,1276772402,-466812838,2084831487,-499646315,101449983,151912454,403701768,1882849305,-398983030,-1858469633,-1642659658
Long mem#,508=-331874087,-672792321,-247922476,1545404671,-2092826502,-1592262494,1713373404,1732378757,1648754813,524404,1110638592,-449314740,1545208063,-432603012,-1758199553,1431699648,-752353191,-921435905,1429471487
Long mem#,584=-667811741,1482555647,1914765401,-1171390333,470941907,-550043617,-954859265,-453836545,225
Long mem#,1076=1012727808,84229453,134744069,1967226373,579105603,50594863,151852558,67567872,1752726585,235471643,856786757,704708870,405485445,50331744,1863673183,1783300609,-2138274210,198459,1351113842,1331298818,-2121495506
Long mem#,1160=67132233,879174755,1196163402,-1936946128,102370416,172115978,756030722,-1936946036,122782496,258370857,321999878,-1936946036,588010380,227109966,-1943240155,-1936946036,529220748,476806015,-1943586805,-1936946036
Long mem#,1240=1077578892,1477597053,-1936972199,-1936946036,389975180,343167551,-1936974217,-1936946036,1988922508,891849270,-1936946055,-1936946036,1653378188,1896568370,-1936946106,-1936946036,-1936946036,2048467305,-1936946036
Long mem#,1316=-1936946036,-1936946036,1683320417,-1936946036,35980
Declare hBild&
hBild& = CatchBmp(mem#)
Dispose mem#
Erstellt am 21. Februar 2010 mit dem XProfan Datengenerator, (C) Frank Abbing
Datei: E:profanXDatengeneratoricon4.png (originale Dateigröße: 1049 Bytes)
Dim mem#,1052
Clear mem#
Long mem#,0=1196314761,169478669,218103808,1380206665,268435456,268435456,776,254617600,50331731,1414287360,886832965,-13247489,-587254310,870121268,-15115140,-570477092,425491765,-13312513,-419480838,669122360,-13045505
Long mem#,84=-117492514,718602042,-1843102576,1532633981,937820004,-14919577,-956352270,365625111,-15284481,-536922657,955186998,1781980927,-369133202,1633378103,-115876353,-469823559,355811127,-2110266625,1616789354,937557867
Long mem#,164=-12913409,1566587104,1014008925,-1791266417,-587253899,1481723441,-32003868,-402713148,972619574,-14365185,1096164575,396615706,-1441486875,-520143225,1079204905,1813535870,-385911188,635633463,1260019326,1263802432
Long mem#,244=1734435391,1865803007,-1461354638,338309399,-15349249,-654363175,954466101,-14983811,-704694293,938147627,-13179649,-1867236877,954531642,-12885130,1955018985,971702050,-14233089,-469813539,766692150,-354101806
Long mem#,324=-486598228,920780598,1909967045,-100696719,-640956614,840584022,1280971820,769982234,-12288875,101071074,235472908,-1978656743,-385926544,982627896,-15229223,-673957652,972160998,-1575134086,-1579400573,543589656
Long mem#,404=1950508925,18018,859982856,2084103679,-419489188,882360375,-11119271,-906024749,878011156,1496504575,1921211992,783995681,-15590369,-939575329,-203103978
Long mem#,808=1181556736,215,1094994388,1671198804,-998047256,135581884,1698824587,559303210,-2061949941,565843825,1972999177,576100457,-305861628,-901494141,1443029221,1122088206,812290321,-110192895,426568442,-1468724370
Long mem#,888=-1299238848,-1356378529,1141805930,-1875271360,-1925762211,1355034015,-1068487656,-439958237,616940769,302751787,1720513640,1230391648,-194842313,167786353,867391540,1959072819,1160851460,821423097,807684968
Long mem#,964=-1480118224,842262154,-1245354119,1214534705,-1175293133,-1290138698,-1251331535,682898330,816886761,1928432115,-1280167886,-1003432360,-1294272294,1886565042,970371184,51853974,1421583616,334163600,79,1313163520
Long mem#,1044=1614982724,130
Bitte nicht vergessen, die Variable mem# zum Programmende wieder freizugeben (Dispose).
Declare hBild1&
hBild1& = CatchBmp(mem#)
Dispose mem#
Cls
*** Bild anzeigen
DrawPic hBild&, 250,180, 1
DrawPic hBild1&, 250,220, 1
while 1
waitinput
Case %key=2:Break
Endwhile
*** Bild freigeben
DeleteObject hBild&
DeleteObjectd1&
FIN
|
| | | | |
| | Frank Abbing | qui Funktion CatchBmp() pouvoir cela, quoi son nom verspricht. vous erzeugt une Grafikhandle aus einer Bmp-Dossier. seulement Bmp, et alors Rle.
Probier fois le données (comme Bitmap) ins Clipboard kopieren et Créer(«PCSI».. et "&CLPBMP" magasin. Ansonsten Tempfile. |
| | | | |
| | Thomas Freier | Frank, merci pour den Hinweis. Hatte qui dernier variante avant einer Weile gewählt et était Je ne sûrement si es avec XProfan 11 maintenant aussi anders possible ist. qui BMP-variante bleibt mir oui encore offen. |
| | | | |
| | | @Thomas: j'ai cela Problem pas verstanden, ist es gelöst?
Andernfalls, ca va Dir tout autor, Bilddaten aus dem grenier (mem#) einem hPic zuzuordnen, um cet anzuzeigen? |
| | | | |
| | Andreas Miethe
| avec einem kleinen le détour klappt es aussi avec PNG,JPG usw. plan alles quoi qui GPIPlus so magasin peux.
Habe den Code la fois um CatchImage erweitert KompilierenMarqueSéparationDeclare bereich#,x&,y&,z&,p&,text$
Def GetSysColor(1) !"USER32","GetSysColor"
SetTrueColor 1
Proc CatchBmp
Parameters MemPointer&
Declare hDC&, BITMAPFILEHEADER#, BMPInfo&, init&, hImage&
hDC& = External("user32.dll", "GetDC", External("user32.dll", "GetDesktopWindow"))
Dim BITMAPFILEHEADER#, 14
BITMAPFILEHEADER# = MemPointer&
BMPInfo& = MemPointer& + 14
init& = MemPointer& + Long(BITMAPFILEHEADER#, 10)
hImage& = External("gdi32.dll", "CreateDIBitmap", hDC&, BMPInfo&, 4, init&, BMPInfo&, 0)
External("user32.dll", "ReleaseDC", External("user32.dll", "GetDesktopWindow"), hDC&)
Dispose BITMAPFILEHEADER#
Return hImage&
EndProc
Proc CatchImage
Struct GdiplusStartupInput = GdiplusVersion&,DebugEventCallback&,SuppressBackgroundThread&,SuppressExternalCodecs&
Var GDIP& = ImportDll("Gdiplus.dll","")
Var OLE& = ImportDll("Ole32.dll","")
Var Kernel& = ImportDll("Kernel32.dll","")
Declare gdpsi#,gdiplusToken&,ImageObject&,GraphicObject&,pStream&,RetVal&
Parameters MemPointer&,Size&
GDIPlus starten
Dim gdpsi#,GdiplusStartupInput
gdpsi#.GdiplusVersion& = 1
gdpsi#.DebugEventCallback& = 0
gdpsi#.SuppressBackgroundThread& = 0
gdpsi#.SuppressExternalCodecs& = 0
GdiplusStartup(ADDR(gdiplusToken&),gdpsi#,0)
Dispose gdpsi#
Speicher bereitstellen
Var m_hBuffer& = GlobalAlloc(2,Size&)
Var pBuffer& = GlobalLock(m_hBuffer&)
RtlMoveMemory(pBuffer&,MemPointer&,Size&)
GlobalUnlock(m_hBuffer&)
Stream erzeugen
CreateStreamOnHGlobal(m_hBuffer&,1,Addr(pStream&))
GdipCreateBitmapFromStream(pStream&,Addr(ImageObject&))
hBitmap erzeugen
GdipCreateHBITMAPFromBitmap(ImageObject&,Addr(RetVal&),0)
aufräumen
Var Command& = Long(pStream&,0)
call(Long(Command&,8),pStream&)IStream.Release
GlobalFree(m_hBuffer&)
GdipDisposeImage(ImageObject&)
GdipDeleteGraphics(GraphicObject&)
GdiplusShutdown(gdiplusToken&)
FreeDll GDIP&
FreeDll OLE&
FreeDll Kernel&
Return RetVal&
EndProc
*** Hier stehen die Bilddaten aus bmp direkt im Quellcode.
Erstellt am 21. Februar 2010 mit dem XProfan Datengenerator, (C) Frank Abbing
Datei: E:profanXDatengeneratoricon4.bmp (originale Dateigröße: 1334 Bytes)
Declare mem#
Dim mem#,1336
Clear mem#
Long mem#,0=87444802
Long mem#,8=70647808,2621440,1048576,1048576,65536,8,16777216
Long mem#,44=16777216
Long mem#,52=-617349120,-617283329,-634060545,-600571649,-600637185,1545142527,-600506244,-583728897,1545142527,-583794563,-96861953,-432537345,-517537537,-264765185,-567017217,-130416385,-735444737,2082734335,2099445904
Long mem#,128=1533280402,-449380262,1478230271,-231210905,-971570945,-904593153,-971636481,-550174465,-550108929,-298319617,-566886145,1853423871,-382271382,1533083903,-585695137,-1190199041,-482934535,890568959,-499711937
Long mem#,204=1782513919,1617625218,-516489122,-197525249,-533200641,1566376191,1882980448,1899692172,1966538895,-600768363,1364721919,-1474887602,-1005256476,-415891202,-130481921,-853278465,-551288577,1092223231,-1558773674
Long mem#,280=-1491861280,-2025979675,-534183766,1396703487,1545076828,1819672702,-399048596,-500891393,1578762495,1075314814,1262420043,1634140244,-466288542,1920925951,-1474887569,705954021,-921370575,-650837761,-667614977
Long mem#,356=-482868993,1562050815,-348716931,-718601985,-365494017,-466222849,-214368001,-1875246849,-466091852,1664811263,-382205834,1948385535,-365363065,-786038529,-583663361,-483000065,-1305673473,-706477877,-1407647534
Long mem#,432=-499777302,-516554497,-925433601,1904017605,-113639311,-874970881,1259995335,739508310,1276772402,-466812838,2084831487,-499646315,101449983,151912454,403701768,1882849305,-398983030,-1858469633,-1642659658
Long mem#,508=-331874087,-672792321,-247922476,1545404671,-2092826502,-1592262494,1713373404,1732378757,1648754813,524404,1110638592,-449314740,1545208063,-432603012,-1758199553,1431699648,-752353191,-921435905,1429471487
Long mem#,584=-667811741,1482555647,1914765401,-1171390333,470941907,-550043617,-954859265,-453836545,225
Long mem#,1076=1012727808,84229453,134744069,1967226373,579105603,50594863,151852558,67567872,1752726585,235471643,856786757,704708870,405485445,50331744,1863673183,1783300609,-2138274210,198459,1351113842,1331298818,-2121495506
Long mem#,1160=67132233,879174755,1196163402,-1936946128,102370416,172115978,756030722,-1936946036,122782496,258370857,321999878,-1936946036,588010380,227109966,-1943240155,-1936946036,529220748,476806015,-1943586805,-1936946036
Long mem#,1240=1077578892,1477597053,-1936972199,-1936946036,389975180,343167551,-1936974217,-1936946036,1988922508,891849270,-1936946055,-1936946036,1653378188,1896568370,-1936946106,-1936946036,-1936946036,2048467305,-1936946036
Long mem#,1316=-1936946036,-1936946036,1683320417,-1936946036,35980
Declare hBild&
hBild& = CatchBmp(mem#)
Dispose mem#
Erstellt am 21. Februar 2010 mit dem XProfan Datengenerator, (C) Frank Abbing
Datei: E:profanXDatengeneratoricon4.png (originale Dateigröße: 1049 Bytes)
Dim mem#,1052
Clear mem#
Long mem#,0=1196314761,169478669,218103808,1380206665,268435456,268435456,776,254617600,50331731,1414287360,886832965,-13247489,-587254310,870121268,-15115140,-570477092,425491765,-13312513,-419480838,669122360,-13045505
Long mem#,84=-117492514,718602042,-1843102576,1532633981,937820004,-14919577,-956352270,365625111,-15284481,-536922657,955186998,1781980927,-369133202,1633378103,-115876353,-469823559,355811127,-2110266625,1616789354,937557867
Long mem#,164=-12913409,1566587104,1014008925,-1791266417,-587253899,1481723441,-32003868,-402713148,972619574,-14365185,1096164575,396615706,-1441486875,-520143225,1079204905,1813535870,-385911188,635633463,1260019326,1263802432
Long mem#,244=1734435391,1865803007,-1461354638,338309399,-15349249,-654363175,954466101,-14983811,-704694293,938147627,-13179649,-1867236877,954531642,-12885130,1955018985,971702050,-14233089,-469813539,766692150,-354101806
Long mem#,324=-486598228,920780598,1909967045,-100696719,-640956614,840584022,1280971820,769982234,-12288875,101071074,235472908,-1978656743,-385926544,982627896,-15229223,-673957652,972160998,-1575134086,-1579400573,543589656
Long mem#,404=1950508925,18018,859982856,2084103679,-419489188,882360375,-11119271,-906024749,878011156,1496504575,1921211992,783995681,-15590369,-939575329,-203103978
Long mem#,808=1181556736,215,1094994388,1671198804,-998047256,135581884,1698824587,559303210,-2061949941,565843825,1972999177,576100457,-305861628,-901494141,1443029221,1122088206,812290321,-110192895,426568442,-1468724370
Long mem#,888=-1299238848,-1356378529,1141805930,-1875271360,-1925762211,1355034015,-1068487656,-439958237,616940769,302751787,1720513640,1230391648,-194842313,167786353,867391540,1959072819,1160851460,821423097,807684968
Long mem#,964=-1480118224,842262154,-1245354119,1214534705,-1175293133,-1290138698,-1251331535,682898330,816886761,1928432115,-1280167886,-1003432360,-1294272294,1886565042,970371184,51853974,1421583616,334163600,79,1313163520
Long mem#,1044=1614982724,130
Bitte nicht vergessen, die Variable mem# zum Programmende wieder freizugeben (Dispose).
Declare hBild1&
hBild1& = CatchImage(mem#,sizeof(mem#))
Dispose mem#
*** Bild anzeigen
cls
DrawPic hBild&, 250,180, 1
DrawPic hBild1&, 250,220, 1
while 1
waitinput
Case %key=2:Break
Endwhile
*** Bild freigeben
DeleteObject hBild&
DeleteObject hBild1&
FIN
|
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 22.02.2010 ▲ |
| |
| | Thomas Freier | merci Andreas, Problem aus meiner Sicht optimal gelöst. avec cela doit ensuite pas seulement un Bild erzeugt volonté, cela anschließend wieder gelöscht wird. aussi catchBmp ist ensuite pas plus erforderlich. |
| | | | |
| | Andreas Miethe
| Beachte mais, dass qui GDIPlus.dll seulement ab XP un Bestandteil de Windosw ist. chez älteren Systemen muss (et darf) qui Dll mitgeliefert volonté !! |
| | | Gruss Andreas ________ ________ ________ ________ _ Profan 3.3 - XProfanX2 Win 95,98,ME,2000,XP,Vista - Win 7 32 / 64 Bit ASUS X93S - Intel Core I7-NVIDIA GForce 540M 8GB Arbeitsspeicher Homepage : [...] | 22.02.2010 ▲ |
| |
| | Frank Abbing | peut-être fois le Clipboard-variante ausprobieren, si pre-XP son soll. |
| | | | |
| | | Hab aussi encore une variante pour kleine Bilder: KompilierenMarqueSéparationcls
var hPic&=createHPic.attention_png()
drawPic hPic&,100,10;0
drawPic hPic&,100,50;0
waitinput
end
proc createHPic.attention_png
var hPic&=create("hNewPic",16,16,0)
var data$=decode64("8+ThAPPk4QDz5OEA8+ThAPPk4QDz5OEA18jFADpwigA7Y3YA2cvHAPPk4QDz5OEA8+ThAPPk4QDz5OEA8+ThAPPk4QDz5OEA8+ThAPPk4QDz5OEA8+ThAER8lQAX3f8AFsb/AEZidADz5OEA8+ThAPPk4QDz5OEA8+ThAPPk4QDz5OEA8+ThAPPk4QDz5OEA8+ThAH1xcQAVxP4AOOn/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SAEBTXAAbXX0AGFx+ABlcfAAZXHwAGVx8ABlcfQAZXH0AGVx9ABlcfAAaXHwAGl5+AB1cegA/S1QA5tfUAA==")
external("gdi32.dll","SetBitmapBits",hPic&,1024,addr(data$))
return hPic&
KompilierenMarqueSéparationcls
var fle$=loadFile$("Beliebige Bilddatei","*.*")//fichier qui dans funktion konvertiert volonté soll
casenot fileExists(fle$) : end 1
var fnam$=translate$(substr$(fle$,len(fle$,"\"),"\"),".","_")
var hPic&=create(«PCSI»,-1,fle$)
var x&=%bmpx
var y&=%bmpy
var c&=x&*y&*4
var m&=external("kernel32.dll","GlobalAlloc",64,c&)//64=gPTR
external("gdi32.dll","GetBitmapBits",hPic&,c&,m&)
clearClip
putClip "proc createHPic."+fnam$+"
var hPic&=create(qhNewPicq,"+str$(x&)+","+str$(y&)+",0)
var data$=decode64(q"+encode64(char$(m&,0,c&))+"q)
external(qgdi32.dllq,qSetBitmapBitsq,hPic&,"+str$(c&)+",addr(data$))
return hPic&
endproc
"
end
|
| | | | |
|
répondreOptions du sujet | 2.772 Views |
Themeninformationencet Thema hat 4 participant: |