Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
Y

yoshibebe

@yoshibebe
About
Posts
4
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • bitblt a bitmap greater than screen resolution, bitmap doesn't display correctly
    Y yoshibebe

    I have created a DDB bitmap of size (1024x2048) and have selected it into a compatible DC. Here is the code: hdc = GetDC (hwnd); hBitmap = CreateCompatibleBitmap (hdc, 1024, 2048); hdcMem = CreateCompatibleDC (hdc); SelectObject( hdcMem, hBitmap); ReleaseDC (hwnd,hdc); My problem is when I draw on the hdcMem and then bitblt it to my Window DC. Everything works fine until I try a bitblt with an X coordinate (hdcMem) greater than 800. My current screen Resolution is 800x600. Why is this? How can I fix it? This is not a problem for the Y axis. I suspect that the hdcMem has some sort of limitations based on the current resolution, but I can't figure it out. What happens is that the bitmap seems to be cut in half. The bitmap displays fine up to the 800 point, but after that, it doesn't show at all.

    C / C++ / MFC help question graphics

  • Changing Dialog Font Programmatically
    Y yoshibebe

    Hi, I am trying to change the dialog font programmatically. The dialog right now is created using a Resource file, and the font size and face is hard-coded. I would like to be able to change the font face and size in the OnInitDialog() function. So far this is what I have: HFONT hFont; LOGFONT lf; CFont pFont; short int fRedraw= FALSE; memset(&lf, 0, sizeof(LOGFONT)); hFont = (HFONT) GetStockObject( SYSTEM_FONT ); GetObject(hFont, sizeof(lf), &lf); pFont.CreateFontIndirect(&lf); this->SetFont(&pFont, true); SendMessageToDescendants(WM_SETFONT, (WPARAM)pFont.m_hObject, MAKELONG ((WORD) fRedraw, 0), TRUE); This is changing the font size and face for the CONTROLS of the dialog. However, it does not change anything elose besides that. I tried to do a this->SetFont, however, this does not help. I need the dialog itself to be resized accordingly, and also regular CText. When the font is changed in the resource file, I notice that the dialog size itself changes, however, this is not happening when I call SetFont or send a WM_SETFONT message. Can anyone help me? Thanks!!!

    C / C++ / MFC help question learning

  • COM/ATL trying to write a new interface, getting error base class undefined
    Y yoshibebe

    I've been trying to add a new interface to my application, and for some reason, I keep getting the following error: C2504: IWWAlmDBAck : base class undefined I defined a new interface in an IDL file, and IWWAlmDBAck is using IUnknown. I declare the interface in a header file, underneath a class called CWWAlmDBPrg, declaring it as public IWWAlmDBAck. The error is pointing to the header file, saying that the base class is undefined. However, there are old interfaces defined under CWWAlmDBPrg, and no errors generated from that. Why is it when I add a new one, the error occur? Below is my header code: This is where I got the error, at IWWAlmDBACK class CWWAlmDBPrg : public IWWAlmDBConnection, public IWWAlmDBInfo, public IWWAlmDBTable, public IWWAlmDBProviderSession, public IWWAlmDBQuery, public IWWAlmDBDetailed, public IWWAlmDBConsolidated, public IWWAlmDBCause, public IWWAlmDBComment, public IWWAlmDBDefaultQuery, public IWWAlmDBTagStatus, public IWWAlmDBEvents, public IWWAlmDBErrorInfo, //New Interface: public IWWAlmDBACK, public CComObjectRoot, public CComCoClass { public: CWWAlmDBPrg() Below is code from my IDL: This is where I defined the interface IWWAlmDBACK: //New [ object, uuid(2D65B748-6B53-45e5-A201-74D072F39045), helpstring("IWWAlmDBACK Interface"), pointer_default(unique) ] interface IWWAlmDBACK : IUnknown { [helpstring("method LogAlmAckConsolidated")] HRESULT LogAlmAckConsolidated([in] int AlarmId,[in,string] wchar_t* AckTime,[in] int AckTimeFracSec,[in] int AckTimeZoneOffset,[in] int AckDaylightAdjustment,[in] int OutstandingAcks,[in] int AckCommentId, [in,string] wchar_t* AckOperatorName,[in,string] wchar_t* AckNodeName, [in] double User1, [in] double User2, [in,string]wchar_t* User3, [in] long Cookie); }; //End New I generated the uuid using guidgen.exe I defined the interface in coclass: coclass WWAlmDBPrg { [default] interface IWWAlmDBConnection; interface IWWAlmDBInfo; interface IWWAlmDBTable; interface IWWAlmDBProviderSession; interface IWWAlmDBQuery; interface IWWAlmDBDetailed; interface IWWAlmDBConsolidated; interface IWWAlmDBCause; interface IWWAlmDBComment; interface IWWAlmDBDefaultQuery; interface IWWAlmDBTagStatus;

    COM c++ com help question

  • rotating transparent bitmap causes a halo of transparent color around bitmap
    Y yoshibebe

    When I rotate a transparent bitmap, the transparent background color will be drawn around the bitmap (a one pixel halo). This doesn't happen when the rotation is horizontal or vertical. I am doing the following masking: BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMaskDC, 0, 0, SRCAND ); BitBlt( hScreenDC, r.left, r.top, curWidth, curHeight, hMemoryDC, 0, 0, SRCINVERT ); At this point I have no clue as to why something like this would occur, because I have rotated the whole bitmap and saved it into the DC's. Has this happened to anyone before? Thanks!

    C / C++ / MFC graphics question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups