Click here to Skip to main content
15,886,046 members

anfuson - Professional Profile



Summary

    Blog RSS
5
Debator
22
Organiser
374
Participant
0
Author
0
Authority
0
Editor
0
Enquirer
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
QuestionHow to process fullscreen? .NET CF C# (windows mobile) Pin
anfuson9-Aug-09 22:31
anfuson9-Aug-09 22:31 
Generaltest Pin
anfuson3-Jul-09 22:30
anfuson3-Jul-09 22:30 
public MainForm()
        {
            InitializeComponent();

            backBuffer = new Bitmap(this.ClientSize.Width, this.ClientSize.Height, System.Drawing.Imaging.PixelFormat.Format32bppRgb);

            // The other radio buttons have their tag set in InitializeComponent().
            radioButton4.Tag = Color.FromArgb(255, 255, 192);

            // Load the image to use with the AlphaBlend API.
            string path = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().GetName().CodeBase); 
            constantAlphaImage = new Bitmap(path + @"\blendme.bmp");

            // Load the image with alpha data through Imaging.
            // We don't need the factory later, so it is local (and temporary).
            IImagingFactory factory = (IImagingFactory)Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("327ABDA8-072B-11D3-9D7B-0000F81EF32E")));
            factory.CreateImageFromFile(path + @"\ihavealpha.png", out imagingImage);

            // Load the image with alpha data from an embedded resource through Imaging
            // !! If your data source is not a MemoryStream, you will need to get your image data into a byte array and use it below. !!
            MemoryStream strm = (MemoryStream)Assembly.GetExecutingAssembly().GetManifestResourceStream("AlphaExample.embedded.png");
            byte[] pbBuf = strm.GetBuffer();
            uint cbBuf = (uint)strm.Length;
            factory.CreateImageFromBuffer(pbBuf, cbBuf, BufferDisposalFlag.BufferDisposalFlagNone, out imagingResource);
        }



private void Form1_Paint(object sender, PaintEventArgs e)<br />
        {<br />
            // We are going to double buffer to cut down on flicker.<br />
            // This isn't foolproof on slower devices (we can see the fullscreen Blt).<br />
            // You could trade space for speed and keep this background buffer around<br />
            // rather than (re)creating it each time Paint is called.  I would hook Resize and<br />
            // create a new back buffer in that event.<br />
<br />
            // The bitmap needs to be created with the 32bpp pixel format for the IImage to do the right thing.<br />
            if (backBuffer != null)<br />
            {<br />
                // We beed a Graphics object on the buffer to get an HDC<br />
                using (Graphics gxBuffer = Graphics.FromImage(backBuffer))<br />
                {<br />
                    // Since we nop'd OnPaintBackground, take care of it here<br />
                    gxBuffer.Clear(this.BackColor);<br />
<br />
                    // Ask the Image object from Imaging to draw itself.<br />
                    IntPtr hdcDest = gxBuffer.GetHdc();<br />
                    Rectangle dstRect = new Rectangle(100, 100, 148, 148);<br />
                    imagingResource.Draw(hdcDest, ref dstRect, IntPtr.Zero);<br />
                    gxBuffer.ReleaseHdc(hdcDest);<br />
<br />
                    // AlphaBlend takes two HDC's - one source and one destination.  Here's the source.<br />
                    using (Graphics gxSrc = Graphics.FromImage(constantAlphaImage))<br />
                    {<br />
                        IntPtr hdcDst = gxBuffer.GetHdc();<br />
                        IntPtr hdcSrc = gxSrc.GetHdc();<br />
                        BlendFunction blendFunction = new BlendFunction();<br />
                        blendFunction.BlendOp = (byte)BlendOperation.AC_SRC_OVER;   // Only supported blend operation<br />
                        blendFunction.BlendFlags = (byte)BlendFlags.Zero;           // Documentation says put 0 here<br />
                        blendFunction.SourceConstantAlpha = (byte)vScrollBar1.Value;// Constant alpha factor<br />
                        blendFunction.AlphaFormat = (byte)0;                        // Don't look for per pixel alpha<br />
                        PlatformAPIs.AlphaBlend(hdcDst, 36, 36, 128, 128, hdcSrc, 0, 0, 128, 128, blendFunction);<br />
                        gxBuffer.ReleaseHdc(hdcDst);    // Required cleanup to GetHdc()<br />
                        gxSrc.ReleaseHdc(hdcSrc);       // Required cleanup to GetHdc()<br />
                    }<br />
<br />
                    // Ask the Image object from Imaging to draw itself.<br />
                    /*IntPtr*/ hdcDest = gxBuffer.GetHdc(); // This is redundant, but keeps the necessary code together<br />
                    /*Rectangle*/ dstRect = new Rectangle(4, 4, 132, 132);<br />
                    imagingImage.Draw(hdcDest, ref dstRect, IntPtr.Zero);<br />
                    gxBuffer.ReleaseHdc(hdcDest);<br />
                }<br />
<br />
                // Put the final composed image on screen.<br />
                e.Graphics.DrawImage(backBuffer, 0, 0);<br />
            }<br />
            else<br />
                e.Graphics.Clear(this.BackColor);<br />
        }<br />

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.