Sorry.... this is another how to save question.
I have looked in every forum for a solution, and I think I have tried every solution with no success.
I guess Im a complete idiot or old...same thing I guess.
Im attempting to perform some simple image manipulation using a simple form with simple controls and 2 images. Image on left is unmodified, image on right is the modified "preview". any changes to the control (slider etc) invalidate the form calling onpaint. So far so good - nice simple UI , preview works nice .......... until I try to save. Then I get the same old "my changes are not being saved".
Well...my changes are not being saved.
No, I am not using picture boxes , and yes I am creating a bitmap and writing to that as opposed to the control.
No...I am not drawing silly little lines or arcs etc on the picture, and YES I have looked at every bit of GDI documentation I could find (most of which is junk!).
Please point out my stupid blunder:
Please forgive my ignorance as I normally write code that does something bigger than playing with silly little pictures or worse..games.
My wife has requested a small app to manipulate some images...I wisely replied with a "Yes dear"....here we are....
Help me..... the sooner I can get this thing behind me the sonner I can get out of this silly GDI thing,.
I have looked in every forum for a solution, and I think I have tried every solution with no success.
I guess Im a complete idiot or old...same thing I guess.
Im attempting to perform some simple image manipulation using a simple form with simple controls and 2 images. Image on left is unmodified, image on right is the modified "preview". any changes to the control (slider etc) invalidate the form calling onpaint. So far so good - nice simple UI , preview works nice .......... until I try to save. Then I get the same old "my changes are not being saved".
Well...my changes are not being saved.
No, I am not using picture boxes , and yes I am creating a bitmap and writing to that as opposed to the control.
No...I am not drawing silly little lines or arcs etc on the picture, and YES I have looked at every bit of GDI documentation I could find (most of which is junk!).
Please point out my stupid blunder:
Code:
Private Sub Frm_GDI_SUX_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim ArrayPts As Single()() = {New Single() {1, 0, 0, 0, 0}, _
New Single() {0, 1, 0, 0, 0}, _
New Single() {0, 0, 1, 0, 0}, _
New Single() {0, 0, 0, tpVal, 0}, _
New Single() {0, 0, 0, 0, 1}}
Dim colorMat As New ColorMatrix(ArrayPts)
Dim Attrib As New ImageAttributes()
Attrib.SetColorMatrix(colorMat, ColorMatrixFlag.Default, ColorAdjustType.Bitmap)
Dim ModImg As Image = Image.FromFile(GetFileName(Active_Ctl))
Dim bmp As New Bitmap(ModImg)
e.Graphics.FromImage(bmp)
e.Graphics.DrawImage(bmp, New Rectangle(265, 10, 200, 200), 0, 0, bmp.Width, bmp.Height, GraphicsUnit.Pixel, Attrib)
bmp.Save("c:\GDI_sux.bmp")
End Sub
Please forgive my ignorance as I normally write code that does something bigger than playing with silly little pictures or worse..games.
My wife has requested a small app to manipulate some images...I wisely replied with a "Yes dear"....here we are....
Help me..... the sooner I can get this thing behind me the sonner I can get out of this silly GDI thing,.
Last edited by a moderator: