Hallo Michael,
Michael_HU schrieb:
| Zitat: |  |
Wenn diese Pixelgröße Probleme beim drehen vorbereitet, dann
kann ich das Original selbstverständlich unter 3000 Pixel
machen.
|  |
3000 Pixel sind ein Schätzwert. Du musst mal testen, was
möglich ist. Aber wie schon geschrieben, es gibt auch andere
Möglichkeiten.
Michael_HU schrieb:
| Zitat: |  |
Die ScaleMode vom Picture1 ist jetzt auf 0-User.
|  |
Unabhängig vom ScaleMode der Picturebox arbeiten die Api-Funktionen
immer mit Pixeln.
Michael_HU schrieb:
| Zitat: |  |
Ich möchte das bisherige
"Modullayout_Zeichnungsfläche" in rar hier
beilegen, womit Du alles siehst.
Weiß nicht, ob das so geht.
|  |
Das geht so nicht. Du kannst das Projekt bei einem Webhoster
hochladen und es dann hier verlinken, oder es mir per e-mail
schicken.
Hier ein Beispiel für Drehen um 180°:
' Controls: CommandButton, PictureBox
Private Declare Function SetStretchBltMode Lib "gdi32" (ByVal hdc As Long, _
ByVal nStretchMode As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As _
Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal _
hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As _
Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Const COLORONCOLOR = 3
Private Breite&, Hoehe&
Private Sub Form_Load()
Dim Dat1$, TmpPic As StdPicture
Me.ScaleMode = vbPixels
Me.WindowState = vbMaximized
Command1.Move 2, 2
Dat1 = "C:\EinBild.jpeg" ' <- Pfad eines Bildes
Set TmpPic = LoadPicture(Dat1)
With Picture1
.BorderStyle = vbBSNone
.ScaleMode = vbPixels
Breite = Int(0.5 + .ScaleX(TmpPic.Width, vbHimetric))
Hoehe = Int(0.5 + .ScaleY(TmpPic.Height, vbHimetric))
.Move 2, Command1.Height + 4, Breite, Hoehe
.AutoRedraw = True
.PaintPicture TmpPic, 0, 0
End With
Set TmpPic = LoadPicture()
End Sub
Private Sub Command1_Click()
Dim OldMode&
With Picture1
OldMode = SetStretchBltMode(.hdc, COLORONCOLOR)
Call StretchBlt(.hdc, Breite - 1, Hoehe - 1, -Breite, -Hoehe, _
.hdc, 0, 0, Breite, Hoehe, vbSrcCopy)
Call SetStretchBltMode(.hdc, OldMode)
.Refresh
End With
End Sub Quelle und Ziel können bei SetStretchBlt verschieden sein.
Gruss,
Zardoz |