Bitmap aus Resources

  • VB.NET

Es gibt 7 Antworten in diesem Thema. Der letzte Beitrag () ist von Adam.

    Bitmap aus Resources

    Hi,

    könntet Ihr mir da mal helfen?

    so gehts schon mal nicht... Meldung: Datei nicht gefunden...

    VB.NET-Quellcode

    1. Dim a As New Bitmap(Bitmap.FromFile("DIMS_2010\Resources\168.png"), a_W, a_H)


    so gehts auch nicht... My.Resources wird blau unterlet... FromResources ist kein Member von My.

    VB.NET-Quellcode

    1. Dim a As New Bitmap(My.FromResource._168.png, a_W, a_H)


    Wie müßte die Zeile den sonst aussehen ?

    Alex
    so erstelle ich mein bild wenn ich es aus einer Datei lade...

    passt sich der PicBox an...

    VB.NET-Quellcode

    1. Me.pb1.SizeMode = PictureBoxSizeMode.Zoom
    2. Dim a_H = (pb1.Height / 3 * 2) - 11
    3. Dim a_W = pb1.Width
    4. Dim c_H = (pb1.Height / 3 * 2) / 3
    5. Dim c_W = pb1.Width
    6. Dim a As New Bitmap(Bitmap.FromFile(Doc_ThumbnailFullPfad), a_W, a_H) ' 1240, 1754)
    7. Dim c As New Bitmap(Bitmap.FromFile(Doc_ThumbnailFullPfad), c_W, (c_H + 50)) '1240, 877)
    8. c.RotateFlip(RotateFlipType.RotateNoneFlipY)
    9. Dim b As New Bitmap(pb1.Width, pb1.Height)
    10. Dim g As Graphics = Graphics.FromImage(b)
    11. g.DrawImage(a, 0, 0)
    12. Dim p As Pen
    13. p = New Pen(System.Drawing.Color.Gainsboro)
    14. g.DrawLine(p, 0, (a.Height + 5), a.Width, (a.Height + 5))
    15. 'g.DrawImage(c, 0, (a.Height + 11))
    16. g.DrawImage(c, New Rectangle(0, (a.Height + 11), a_W, (c_H + 50)))
    17. g.FillRectangle(New SolidBrush(Color.FromArgb(128, 255, 255, 255)), New Rectangle(0, (a.Height + 11), a_W, (a_H + 50)))
    18. Dim f As New Font("Tahoma", 14)
    19. Dim pinsel As New SolidBrush(Color.Orange)
    20. g.DrawString(Dokumentenbezeichnung, f, pinsel, 0, (a.Height - 22))
    21. Dim pinsel2 As New SolidBrush(Color.NavajoWhite)
    22. g.ScaleTransform(1, -1.0F)
    23. g.DrawString(Dokumentenbezeichnung, f, pinsel2, 2, -(a.Height + 40))
    24. Me.pb1.SizeMode = PictureBoxSizeMode.Zoom
    25. g.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic
    26. pb1.Image = b


    @jvbsl - weist ja, bin ja immer noch Anfänger... dafür ist doch der obrige Code schon mal gar niht so schlecht oder?