I am trying to use undo in my program, so I made a class to do this (see attatched) and I put a bitmap in an instance of this class BEFORE I change the bitmap object. the function for the undo click event calls a function of the undobuf class that returns object and I cast it to bitmap and assign it to the Bitmap and then refresh the form. now, the problem is, that somehow, it is saving the changed version of the bitmap, even though I saved it before I did the change. full source for form attatched. Please help
also it will only work with 24bit bitmaps, how do I change how I use the setpixel, so that it will work with all bitmaps?
Last edited by phirestalker; February 21st, 2003 at 03:28 AM.
this would return a pure object and that's it. you need to implement another mechanism to get the bitmap and not the object. its not even stream but a pure object. how can u convert to a bitmap from a pure object !! no connection !!
no the purpose for object is converting one object from another objects of compatible types and compatible classes. its whole story about OOP.
but for timebeing you can't cast like this.
it doesn't have bitmap data.
realize that b is just a object and bitmap is more even huge in that. how can it accomodate that space anyway..
I ran accross a class called Stack, in System.Collections and I was gonna use that for the undo, but it didn't have an event for empty. Anyway, this Stack class returns object, so how does it work with any kind of data??? like in an example it shows it being used for text, and another used for pictures. If their class can do it, what am I doing wrong, I want to be able to use this class in any program I make without modifying it. Thank u
I guess I'll just have to specialize it that way. Only the built in functions have the luxury of dealing with any kind of data
oh BTW the SetPixel method of the Bitmap class, it will only work on 24bit bitmaps. I have tried different methods and can't get it to work with other types. if it doesn't work with anything but 24bit by design and there is no way to get around it, how would I go about converting bitmaps into 24 bit before working on them?
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.