Italia
Foro

GDI+ und MultiTif

 

Thomas
Freier
Die Beispiele von Andreas [...]  sind ja recht ausführlich. Leider finde ich kein Beispiel um ein MultiTiff zu erstellen, und meine Versuche endeten im Einzelbild oder Nichts.
Wer kennt sich damit aus und kann helfen?
Ein kleines Grundgerüst und Andreas File:
'Multipage Tif's Mostra:
'Andreas Miethe * Februar 2004
'##############################
 $H windows.ph
 $H Functions_GDIPLUS.ph
 $H GDIP_Imageging.ph
 $I GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,GraphicObject&,Count&,X&,XX&,YY&,SIO&
Declare ImageWidth&,ImageHeight&,File$
Declare GUID#
Window 800,600
CLS ~GetSysColor(~COLOR_3DFACE)
gdiplusToken& = InitGDIPlus()'GDIPlus starten
PopUp "Datei"
AppendMenu 109,"Bild öffnen"
AppendMenu 110,"Neues Bild aus Bild 1+2"

Proc ImageObject

    Parameters x&
    declare a$
    MCls 800, 600 , ~GetSysColor(~COLOR_3DFACE)
    MCopyBmp 0,0 - 800,600 > 0,30; 0
    ImageObject& = gdipLoadImage(File$)'Bild laden
    ~GdipCreateFromHWND(%hwnd,ADDR(GraphicObject&))
    Dim GUID#,32
    ~GdipImageGetFrameDimensionsList(ImageObject&,GUID#,1)
    ~GdipImageGetFrameCount(ImageObject&,GUID#,Addr(Count&))
    Settext %hwnd,"Bilder im Multiframe : "+str$(Count&)
    ~GdipImageSelectActiveFrame(ImageObject&,GUID#,X&)
    SaveAsPNG(ImageObject&,"Bild "+str$(x&)+".png")
    ~GdipDrawImageI(GraphicObject&,ImageObject&,30,30)
    Dispose GUID#
    ~GdipDisposeImage(ImageObject&)
    ~GdipDeleteGraphics(GraphicObject&)

Endproc

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Proc NeuMultiImage

    Parameters file$
    Declare ImageID1&, ImageID2&
    'BEISPIEL *******************************************************
    ' // Get the CLSID of the TIFF encoder.
    '  EncoderClsid = GUID$(GdiPlusGetEncoderClsid("image/tiff"))
    ' // Create three image objects.
    '   strFileName = UCODE$("Shapes.bmp")
    '   hStatus = GdipLoadImageFromFile(STRPTR(strFileName), pMulti)
    '   strFileName = UCODE$("Iron.jpg")
    '   hStatus = GdipLoadImageFromFile(STRPTR(strFileName), pPage2)
    ' // Save the first page (frame).
    '   parameterValue = %EncoderValueMultiFrame
    '   strFileName = UCODE$("Multiframe.tif")
    '   hStatus = GdipSaveImageToFile(pMulti, STRPTR(strFileName), EncoderClsid, eps)
    '   IF hStatus = %StatusOk THEN PRINT "Page 1 saved successfully"
    ' // Save the second page (frame).
    '   parameterValue = %EncoderValueFrameDimensionPage
    '   hStatus = GdipSaveAddImage(pMulti, pPage2, eps)
    '   IF hStatus = %StatusOk THEN PRINT "Page 2 saved successfully"
    ' // Close the multiframe file.
    '   parameterValue = %EncoderValueFlush
    '   hStatus = GdipSaveAdd(pMulti, eps)
    '   IF hStatus = %StatusOk THEN PRINT "File closed successfully"
    '****************************************************************
    ImageID1& = gdipLoadImage("Bild 0.png")
    ImageID1& = gdipLoadImage("Bild 1.png")
    ~GdipDisposeImage(ImageID1&)
    ~GdipDisposeImage(ImageID2&)

EndProc

'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Datei$="MultiFrame.tif"
ImageObject 0
var x%=0
var butz%=CreateButton(%hwnd,"<",30,5,20,20)
var butv%=CreateButton(%hwnd,">",60,5,20,20)

while 0=0

    Waitinput

    if GetFocus(butz%) AND (x%>0)

        dec x%
        ImageObject x%
        SetFocus(%hwnd)

    Elseif GetFocus(butv%) AND (x%<Count&-1)

        inc x%
        ImageObject x%
        SetFocus(%hwnd)

    Elseif MenuItem(109)

        datei$ = @LoadFile$("ÖFFNE","Bild|*.Tif")

        If len(trim$(datei$))>0

            ImageObject 0
            x%=0

        EndIf

    EndIf

    case MenuItem(110): NeuMultiImage "ZweiMulti.tif"

wend

DeleteObject bmp&
ExitGDIPlus(gdiplusToken&)
End

181 kB
Hochgeladen:14.11.2011
Downloadcounter165
Download
5 kB
Hochgeladen:14.11.2011
Downloadcounter204
Download
9 kB
Hochgeladen:14.11.2011
Downloadcounter217
Download
46 kB
Hochgeladen:14.11.2011
Downloadcounter216
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
14.11.2011  
 




Andreas
Miethe


Hallo Thomas,

wenn Du ein wenig Geduld hast, dann mache ich Dir die Tage mal ein Beispiel.
 
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 :  [...] 
14.11.2011  
 




Thomas
Freier
Danke Andreas. Zeit spielt keine Rolle.
 
Gruß Thomas
Windows XP SP2, XProfan X2
14.11.2011  
 




Uwe
''Pascal''
Niemeier
Hi Leute!

Vielleicht mal hier gucken:  [...] 

SeeYou
Pascal
 
16.11.2011  
 




Thomas
Freier
Wie immer eine schöne Alternative. Bin erst nach der Nachrüstung der wiaaut.dll zu Ergebnissen gekommen. Da hoffe ich aber, dass die gdipluss.dll immer auf allen BS bis WIN7 schon vorhanden ist, sonst bekomme ich ein Problem.
 
Gruß Thomas
Windows XP SP2, XProfan X2
16.11.2011  
 




Thomas
Freier
Andreas hat das Beispiel mit gdi+ fertig.[...] 
Danke!
 
Gruß Thomas
Windows XP SP2, XProfan X2
20.08.2012  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

Kein Systemprofil angelegt. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Bitte anmelden um einen Beitrag zu verfassen.
 

Topic-Options

6.771 Views

Untitledvor 0 min.
ByteAttack12.10.2015
iF11.05.2015
Andre Rohland14.02.2015
Magda31.08.2014
Di più...

Themeninformationen



Admins  |  AGB  |  Applications  |  Autori  |  Chat  |  Informativa sulla privacy  |  Download  |  Entrance  |  Aiuto  |  Merchantportal  |  Impronta  |  Mart  |  Interfaces  |  SDK  |  Services  |  Giochi  |  Cerca  |  Support

Ein Projekt aller XProfaner, die es gibt!


Il mio XProfan
Private Notizie
Eigenes Ablageforum
Argomenti-Merkliste
Eigene Beiträge
Eigene Argomenti
Zwischenablage
Annullare
 Deutsch English Français Español Italia
Traduzioni

Informativa sulla privacy


Wir verwenden Cookies nur als Session-Cookies wegen der technischen Notwendigkeit und bei uns gibt es keine Cookies von Drittanbietern.

Wenn du hier auf unsere Webseite klickst oder navigierst, stimmst du unserer Erfassung von Informationen in unseren Cookies auf XProfan.Net zu.

Weitere Informationen zu unseren Cookies und dazu, wie du die Kontrolle darüber behältst, findest du in unserer nachfolgenden Datenschutzerklärung.


einverstandenDatenschutzerklärung
Ich möchte keinen Cookie