Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

problems with XPlaceBitmap

tropfen
New Contributor I
758 Views

Hello,

using the source code at the end i have problems with the line:

bSt=XPlaceBitmap(xDC1, xBmp1, 1,1,pBreiteDarstellung,pHoeheDarstellung)

as the result i am getting bSt == .false.

What is wrong with the source code? Everything else is working, from my point of view.

Thanks in advance

Frank

source code :

xDC1 = XMemoryDC(pBreiteDarstellung,pHoeheDarstellung)
CALL XSetViewport(xDC1, 1, 1, pBreiteDarstellung,pHoeheDarstellung)
bSt = XFillViewport(xDC1, X_BRUSH(BS_SOLID, XCOLOR_blue, 0))
bSt = XGetBitmap(xDC1, xBmp1,1, 1, pBreiteDarstellung,pHoeheDarstellung)
bSt = XSaveBitmap(xBmp1, "D: empTemp1.bmp" )
bSt = XDeleteBitmap(xBmp1)
bSt = XDeleteDC(xDC1)

xDC1 = XMemoryDC(pBreiteDarstellung,pHoeheDarstellung)
bSt = XFillViewport(xDC1, X_BRUSH(BS_SOLID, XCOLOR_yellow, 0))
CALL XSetViewport(xDC1, 1, 1, pBreiteDarstellung,pHoeheDarstellung)
bSt=XCreateBitmap(xBmp1, "D: empTemp1.bmp")
bSt = XSaveBitmap(xBmp1, "D: empTemp2.bmp")
bSt=XPlaceBitmap(xDC1, xBmp1, 1,1,pBreiteDarstellung,pHoeheDarstellung)
bSt = XDeleteBitmap(xBmp1)
bSt = XDeleteDC(xDC1)

0 Kudos
7 Replies
Steven_L_Intel1
Employee
758 Views
What are these "X" routine names? Is this from xeffort?
0 Kudos
tropfen
New Contributor I
758 Views
sorry that i have forgotten some information.

My system is based on:
Win XP Prof German SP 2
VS2005 standard German
IVF 9.1.033
XEffort 1.2.20

Thanks for help in advance
Frank
0 Kudos
Jugoslav_Dujic
Valued Contributor II
758 Views

Well, no reason to worry if it works Smiley with tongue out [:-P]

Out of curiosity, what does debugger say when you type bSt, x in the Watch or Quick Watch window? If it's non-zero, there's even less to worry.

The reason might be a "bug" in Xeffort, whereby I (ab)used VF free mixing of integer/logical types too liberally, so you might get false negatives for logical variables. So, erm, don't trust the return value TOO much. I'll probably fix it... some day.

0 Kudos
tropfen
New Contributor I
758 Views
Hello,

Sorry for being slighly incorrect with saying its works. All steps before are working.
XPlaceBitmap does not work. (its has worked on VS2003 German with IVF 9.0.025) No Bitmap is loaded.

At this place thanks for the tool XEffort. It has helpt me a lot.

Frank


0 Kudos
Jugoslav_Dujic
Valued Contributor II
758 Views
Um, I misread your initial comment ("everything else works"). But I don't have an idea why it fails -- XPlaceBitmap just uses BitBlt or StretchBlt APIs, and the reasons for failure as stated in MSDN don't look plausible. What does GetLastError return if you call it immediately after XPlaceBitmap?
0 Kudos
tropfen
New Contributor I
758 Views
Hello,
iSt=GetLastError() gives the result iSt=6
Frank

0 Kudos
Jugoslav_Dujic
Valued Contributor II
758 Views
That's an "invalid handle", which means that either XCreateDC or XCreateBitmap have failed, and either xDC1%hDC or xBmp1%hBmp are invalid (likely, zero). I can't tell the reason with available data (invalid path to the .bmp file?) but some more debugging and GetLastErrors (list of error codes can be found here)
0 Kudos
Reply