English
Source / code snippets

Image turn Gdiplus Image Jpg Rotation Save

 
- Page 1 -


Related: turn without GDI+:  [...] 
Thanks on Andreas Miethe!
example :
 $H windows.ph
 $H includes\Functions_GDIPLUS.ph
 $H includes\GDIP_Imageging.ph
 $I includes\GDIP_Helper.inc
Declare gdiplusToken&,ImageObject&,GraphicObject&,ImageWidth&,ImageHeight&
Declare SIO&,DC&,BMP&,Brush&
CLS ~GetSysColor(~COLOR_3DFACE)
gdiplusToken& = InitGDIPlus()GDIPlus started
Image loading
ImageObject& = gdipLoadImage(eisbaer.jpg) way adjust

If ImageObject&

    ~GdipGetImageWidth(ImageObject&,ADDR(ImageWidth&))wide detect
    ~GdipGetImageHeight(ImageObject&,ADDR(ImageHeight&))Hoehe detect
    DC& = ~CreateCompatibleDC(%hdc)SpeicherDC
    wide and Höhe errechnet itself from the Bilddiagonalen
    BMP& = ~CreateCompatibleBitmap(%hdc,INT(Sqrt((ImageWidth&^2)+(ImageHeight&^2))),INT(Sqr t((ImageWidth&^2)+(ImageHeight&^2))))Memory bitmap
    Brush& = ~CreateSolidBrush(RGB(0,0,0))Brush
    ~SelectObject(DC&,BMP&)Memory bitmap in SpeicherDC
    ~SelectObject(DC&,Brush&)Brush for SpeicherDC
    ~Rectangle(DC&,0,0,491,491)rectangle draw
    ~GdipCreateFromHDC(DC&,ADDR(GraphicObject&))Graphics-of SpeicherDC
    ~GdipRotateWorldTransform(GraphicObject&,Single(45.0),1)Rotation settle
    ~GdipDrawImageRectI(GraphicObject&,ImageObject&,(ImageHeight&/2),-(ImageHeight&/ 2),ImageWidth&,ImageHeight&)
    ~GdipCreateBitmapFromHBITMAP(BMP&,0,Addr(SIO&))Image of Memory bitmap
    SaveAsJPG(SIO&,AX.jpg,30) Image Save
    straighten up
    ~GdipDeleteGraphics(GraphicObject&)
    ~GdipDisposeImage(ImageObject&)
    ~GdipDisposeImage(SIO&)
    ~DeleteObject(BMP&)
    ~DeleteObject(Brush&)
    ~DeleteDC(DC&)

Endif

Print ready
Waitinput
ExitGDIPlus(gdiplusToken&) GDIPlus terminate
End
salvo, iF.
 
11/16/05  
 



 
- Page 1 -


The have I in these demonstration found with the I now my experiemente make.
knows but not whether any command from the GDI include are.

mfg

505 kB
Hochgeladen:02/16/09
Downloadcounter205
Download
 
02/16/09  
 



Sag me rather, How I The wmf-File transparent abspeichern can with Paintshop.
 
02/16/09  
 




E.T.
@Peter: can because .wmf at all transparent ??
Have even time through div. Program geschaut, keines bid .wmf-Save with transparency on.
 
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...
02/16/09  
 



 
- Page 2 -


Hello!

an possible response to question Transparent windows metafile (WMF) finds one on
[...] 

Zit. sinngemäß: theoretical does it already, in the practice kennen we but no Tool, with the the simply goes. therefore there two possible Approaches:

1. Wandle parallel To your Ausgangsbitmap a Transparenzmaske along into the wmf Metafile, and use ensprechende Bitmap-Operationen, before You The Bilddatei really anzeigst.
Quote: I dont know of any program that can do approached number 1., means: the author knows no Program the the can... or

2. Vektorisiere the image and entferne then any Bildteile with Backgroundcolor.
Nutze daszu one Vektorisierungsprogramm, circa in that Metafile stature To konvertieren.
then use one Program How z.B. * Metafile Companion, around the Hintergrundfärbigen items To delete.

further Porgramme, The the can, are (allegedly)
* HiJaak per of IMSI or
* Adobe illustrator of Adobe
* KVEC from KK-software can the nachgewiesenermaßen too right well, has but a great many Options, not only for WMF. Gibts for windows and many others Plattformen.
Zit.end

Well.. direct Help wars no, but naja, eachone tutet what it can...

greeting
Peter woodpecker
 
02/16/09  
 




E.T.
without me now The demonstration anzuschauen: must it because wmf his ??
 
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...
02/16/09  
 



]must it because wmf his ??

If of/ one knows How one with GDI-plus too a png with Alpha Channel as transparent invite can? would be too ne Solution.
with the WMF can I one Image over the others lay and one sees The back figures without thats of Viereck covers go.
 
02/17/09  
 




Thomas
Freier
the Example of Andreas shows only, that too *.wmf uses go can. Presumably but in *.bmp transformed go. not tested: Save as *.gif.
there The *.wmf vektorisiert is, is it no Completed: of/ one suitable Sofware this Image its lines and Flächen To decompose and any not coloured reaches stay transparent(example). loaded in a Bildverarbeitung, becomes automatically one background created. becomes the image (here the dog) over IrfanView as *.png or *.gif transparent stored, so becomes The as transparent chosen colour too reaches in the dog transparent present, though here z.B.: weisse Flächen receive stay should. an Possibility: whom dog on a farbigen background (The colour must then but in the dog not vorkommen) copy and a *.png or *.gif create.
Help XProfan 11:


XProfan supported ex Version 11 the MetaFile-stature. it'll sowohl the ältere stature (windows MetaFile *.wmf) as well as the newer erweiterte stature (Enhanced MetaFile *.emf) recognized.

with Create(hPic,..) and others Bitmapbefehlen can of course too Metafiles (*.wmf and *.emf) loaded go, though go here The Graphics in bitmap transformed, The The Originalgröße the urspünglichen Metafiles having. this is too furthermore meaningfully, if one of Graphics, The as Metafiles exist, one Bitmaphandle needed, about circa tappt im dunkeln in Toolbars or on Buttons To use.

MetaFiles are but no Bitmaps, separate solely Befehlsfolgen, circa Graphics to drawing, as it z.B. too with Vektororientierten Grafikprogrammen, How about CAD and Publikations-software normally is. there The Graphics in beliebiger Size drawn go can, stay tappt im dunkeln too spicy, as they larger drawn go, as The Ursprungsgröße was. with Bitmaps against go with enhancement only The Pixel larger and deutlicher visible.

with @create(hMetaFile becomes one MetaFile becomes loaded and the suitable lever zurückgeliefert. After use must the lever again DeleteObject entsorgt go. teh folks windows-MetaFiles (*.wmf) go automatically into neueren Enhanced MetaFiles transformed. The System-Variables %MFX and %MFY include The ursprüngliche Size the graphic. the MetaFile becomes on the screen (or printer) with the commands PlayMetaFile drawn.


36 kB
Hochgeladen:02/17/09
Downloadcounter257
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
02/17/09  
 




Rolf
Koch
I wisely of course not whether the now somehow fit, but the stature PNG is next to GIF too transparentfähig.
 
02/17/09  
 



I wisely of course not whether the now somehow fit, but the stature PNG is next to GIF too transparentfähig

Very interestingly.

Zeig me now then even time, How I the in GDIPlus realisiere?

mfg
 
02/17/09  
 




Thomas
Freier
means whom employment of/ one *.gif or *.png on place the *.wmf ?

41 kB
Hochgeladen:02/17/09
Downloadcounter250
Download
 
Gruß Thomas
Windows XP SP2, XProfan X2
02/17/09  
 



so, thanks. now functions it.

The GIF and PNG must 8bit-colours his. and the channel for must in Paintshop on Transparent set go.

the I had not geschnallt.

now walk my own Images.

mfg
 
02/17/09  
 



Related: turn without GDI+: [...] 
 
11/08/11  
 




Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

28.407 Views

Untitledvor 0 min.
Thomas Freier02/16/24
H.Brill09/27/23
Uwe Lang09/19/23
p.specht06/13/22
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie