473,396 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to call SetROP2 to set the current foreground mix mode in GDI+

Hi guys,

As you know, we can call SetROP2 to set the current foreground mix mode
in GDI. But I doesn't work in GDI+.
The step is: GetDC --> SetROP2 -->Graphics.FromDC, then draw sth by graphics
object.

How to realize it in GDI+?
Nov 16 '05 #1
2 6076
The raster-op modes will not work in GDI+ at-all.

You can use SetROP2 and then draw exclusively with GDI commands via interop
but using GDI+ commands on a Graphics object created from a DC which has had
the raster-op modified will show no change.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Image transition effects, snap-to-grid and Layered Windows are
all discussed in May's edition of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"°Ë´óɽÈË" <zh**********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
Hi guys,

As you know, we can call SetROP2 to set the current foreground mix mode in GDI. But I doesn't work in GDI+.
The step is: GetDC --> SetROP2 -->Graphics.FromDC, then draw sth by graphics object.

How to realize it in GDI+?

Nov 16 '05 #2
If you're trying to XOR-on a line, you can use
ControlPaint.DrawReversibleLine.
There are some other options too, for more read this:
http://msdn.microsoft.com/library/de...ui02172004.asp

Hope that helps.

--
John Wood
EMail: first name, dot, second name at priorganize.com
"°Ë´óɽÈË" <zh**********@hotmail.com> wrote in message
news:O5**************@TK2MSFTNGP09.phx.gbl...
Hi guys,

As you know, we can call SetROP2 to set the current foreground mix mode in GDI. But I doesn't work in GDI+.
The step is: GetDC --> SetROP2 -->Graphics.FromDC, then draw sth by graphics object.

How to realize it in GDI+?

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Prakash Wadhwani | last post by:
I have 3 fields : First_Name, Last_Name & Policy_Number I'm using a continuous form. If I invoke conditional formatting on First_Name & set a condition of "Prakash" (change the foreground to...
7
by: rahul8143 | last post by:
hello, what is difference between system call and library function call? Does library function call can have context switch to kernel mode? regards, rahul
2
by: Amit W. | last post by:
Hi I'm trying to use Rockford Lhotka's "Implementing a Background Process in Visual Basic .NET" in C#" ...
7
by: one2001boy | last post by:
Hello, I have an executable file lanuched from another application. is there a way to make thie executable file foreground if it is launched from other application? Thanks.
0
by: Alex Pierson | last post by:
I am using SetROP2 to set the mix mode of a window's rectangle as R2_NOT and rectangle to draw a box around the window in inverse color. My problem is determining whether the current state of the...
4
by: ghadley_00 | last post by:
Hi, Can anyone recommend a piece of VBA code I could attach to a button in a MS Form form that will close the current form and bring the switchboard to foreground. I'm trying to integrate a form...
4
by: Carsten Schmitt | last post by:
Hello, I want to draw a simple pixel (i.e. a red pixel in the center of the screen), which is always in the foreground - even when running a fullscreen application like a DirectX game. I need...
8
by: =?Utf-8?B?R3JlZyBMYXJzZW4=?= | last post by:
I'm trying to figure out how to modify a panel (panel1) from a backgroundworker thread. But can't get the panel to show the new controls added by the backgroundwork task. Here is my code. In...
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.